If you have a sequence:
example='abcdefabcdefabcdefg'
and your searching for:
searching_for='abc'
what function would give you a list with all the positions?
positions=[(0,2),(6-8),(12-14)]
i created a window list that splits ‘example’ by 3 so it goes from ‘abc’,’bcd’,’cde’
windows=['abc', 'bcd', 'cde', 'def', 'efa', 'fab', 'abc', 'bcd', 'cde', 'def', 'efa', 'fab', 'abc', 'bcd', 'cde', 'def']
and used a for loop
for i in windows:
if i == 'abc':
thats where i get stuck . . .
You can use regular expressions; the match objects come with position information attached. Example using Python 2: