import res='2223334441214844'print([x.group() for x in re.finditer(r'(\d)\1*', s)])
Standard input is empty
['222', '333', '444', '1', '2', '1', '4', '8', '44']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!