fork download
  1. # your code goes here
  2.  
  3. import re
  4.  
  5. str = "the quick brown(fox).jumps(over + the) = lazy[dog];"
  6.  
  7. print re.findall(r"\w+|[^\w\s]", str)
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
['the', 'quick', 'brown', '(', 'fox', ')', '.', 'jumps', '(', 'over', '+', 'the', ')', '=', 'lazy', '[', 'dog', ']', ';']