import reline = 'APPLE,ORANGE CHERRY APPLE'l = re.findall(r'[^,\s]+|,', line)print(l)
Standard input is empty
['APPLE', ',', 'ORANGE', 'CHERRY', 'APPLE']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!