>>> match = re.findall(r\'\\w\\w\', \'hello\')
>>> print match
[\'he\', \'ll\']
Since \\w\\w means two characters, \'he\' and \'l
Am no regex expert but I would like to answer my similar question.
If you want to use a capture group with the lookahead:
example regex: (\d)(?=.\1)
string: 5252
this will match the first 5 as well as the first 2
The (\d) is to make a capture group, (?=\d\1) is to match any digit followed by the capture group 1 without consuming the string, thus allow overlapping