fork download
  1. import re
  2. re_pattern = r"[a-zA-Z]+(?:'[a-zA-Z]+)?"
  3. sent = "I can't understand what I'm doing wrong or if I made a mistake."
  4. print( re.findall(re_pattern, sent) )
Success #stdin #stdout 0.03s 9412KB
stdin
Standard input is empty
stdout
['I', "can't", 'understand', 'what', "I'm", 'doing', 'wrong', 'or', 'if', 'I', 'made', 'a', 'mistake']