import retext = "aaabbbbcca"print( [x.group(1) for x in re.finditer(r'(?=((.)\2*))', text)] )
Standard input is empty
['aaa', 'aa', 'a', 'bbbb', 'bbb', 'bb', 'b', 'cc', 'c', 'a']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!