fork(3) download
  1. import re
  2. rx = r"\w+(?:'\w+)?|[^\w\s]"
  3. s = "I don't like to eat Cici's food (it is true)"
  4. print(re.findall(rx, s))
Success #stdin #stdout 0.01s 23336KB
stdin
Standard input is empty
stdout
['I', "don't", 'like', 'to', 'eat', "Cici's", 'food', '(', 'it', 'is', 'true', ')']