fork download
  1. def latin_ish_words(text):
  2. import re
  3. pattern = r"(?i)(?<!\S)\w*(?:tion|ex|ph|[oia]st)\w*(?!\S)"
  4. return re.findall(pattern, text)
  5.  
  6. print(latin_ish_words("This functions as expected"))
Success #stdin #stdout 0.02s 9448KB
stdin
Standard input is empty
stdout
['functions', 'expected']