fork download
  1. import re
  2. sstring = "ON Any ON Any"
  3. rx = re.compile(r''' \bON\ ANY\b ''', re.VERBOSE|re.IGNORECASE)
  4. for a in rx.findall(sstring):
  5. print(a)
  6.  
Success #stdin #stdout 0.01s 9024KB
stdin
Standard input is empty
stdout
ON Any
ON Any