i'm trying to get the start and end positions of a query in sequence by using re.findall
import re
sequence = 'aaabbbaaacccdddeeefff'
query = 'aaa'
findall = re.findall(query,sequence)
>>> ['aaa','aaa']
how do i get something like findall.start() or findall.end() ?
i would like to get
start = [0,6]
end = [2,8]
i know that
search = re.search(query,sequence)
print search.start(),search.end()
>>> 0,2
would give me only the first instance