I need to find starting and ending positions of variable length sequences of chars, consisting of same 1 letter inside a string. I saw this topic Finding multiple occurrences of a string within a string in Python, but I assume it's a bit off.
The following gives me nothing, while I expect to have 5 elements found.
import re
s = 'aaaaabaaaabaaabaaba'
pattern = '(a)\1+'
for el in re.finditer(pattern, s):
print 'str found', el.start(), el.end()
Thanks in advance.