fork download
  1. import re
  2. rx = r"\bEOL\s+\w+|(?<!\d)([09]?\d{5})(?!\d)"
  3. ss = ["EOL I11011", "942194", "42143", "weoijf23412dfd"]
  4. for s in ss:
  5. m = re.search(rx, s)
  6. if m and m.group(1):
  7. print(m.group(1))
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
942194
42143
23412