fork download
  1. import re
  2.  
  3. items = ["singer","singing","ing","This is a ing testing singalong"]
  4. pattern = r"\b\w*ing(?!\w*ing$)\w+\b"
  5.  
  6. for item in items:
  7. result = re.findall(pattern, item)
  8. if result:
  9. print(result)
  10.  
Success #stdin #stdout 0.02s 9376KB
stdin
Standard input is empty
stdout
['singer']
['singalong']