fork download
  1. import re
  2. s = "US Central Operations | 0054 '0054','0008',or '0009' to be a match, but i would want '10354' or '10032', or '9005', or '9000'"
  3. print(re.findall(r'(?<!\d)[1-9]\d{3,4}(?!\d)', s))
  4.  
Success #stdin #stdout 0.03s 9900KB
stdin
Standard input is empty
stdout
['10354', '10032', '9005', '9000']