# your code goes here import re str = "the quick brown(fox).jumps(over + the) = lazy[dog];" print re.findall(r"\w+|[^\w\s]", str)
Standard input is empty
['the', 'quick', 'brown', '(', 'fox', ')', '.', 'jumps', '(', 'over', '+', 'the', ')', '=', 'lazy', '[', 'dog', ']', ';']