fork download
  1. import re
  2. text = 'Good Morning \nHello There - PROTECT FROM FREEZE\nprotect from freeze \nFORKLIFT UNLOAD -PLEASE HAVE SKID AT TAIL \nThank you'
  3. res = re.findall(r'[^-\n]*\bF(?:REEZE|ORKLIFT)\b[^-\n]*', text, re.IGNORECASE)
  4. print( [x.strip() for x in res] )
Success #stdin #stdout 0.03s 9504KB
stdin
Standard input is empty
stdout
['PROTECT FROM FREEZE', 'protect from freeze', 'FORKLIFT UNLOAD']