import res = 'let a = 5 * (other) if x is "constant";'print( re.findall(r'"[^"]*"|\w+|[^\w\s]', s) )
Standard input is empty
['let', 'a', '=', '5', '*', '(', 'other', ')', 'if', 'x', 'is', '"constant"', ';']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!