fork download
  1. import re
  2.  
  3. rx = re.compile(r'\s*(\S+)\s*')
  4.  
  5. string = """(CNN)Meaalofa Te'o -- Buemi. Canberra,"""
  6. words = rx.findall(string)
  7. print(words)
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
['(CNN)Meaalofa', "Te'o", '--', 'Buemi.', 'Canberra,']