import res = "aa,bb11,22 , 33 , 44,cc , dd "result = re.findall(ur"(?:^\s*|(?<=\d)\s*,\s*)(.*?)(?=\s*,\s*\d|\s*$)", s)print(result)
Standard input is empty
['aa,bb11', '22', '33', '44,cc , dd']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!