fork download
  1. import re
  2. rx = r"(\S+)\s+(?:gun store|establishments|supermarket)\b"
  3. text = "As reported on 30 December 2019, in Maipu, Metropolitan region, a group of at least 10 rioters attempted to loot a local gun store."
  4. m = re.search(rx, text)
  5. if m:
  6. print(m.group(1))
Success #stdin #stdout 0.04s 9492KB
stdin
Standard input is empty
stdout
local