I found this:
>>> re.findall(r'((.)\2*)',s)
[('111', '1'), ('22', '2'), ('1', '1')]
>>> s
'111221'
>>>
I'm not able to follow \2*, how does the regex worked: first group gives me the second group char repeating in s. Its amazing!
\2 meaning the second group, but what is the second group here?!
Note: this is to get number of times a char repeating in a string.