fork download
  1. import re
  2. p = re.compile(r'\b(?!914)\d{3}\b')
  3. test_str = "123\n235\n456\n1000\n910 911 912 913\n 914\n915 916"
  4. print(re.findall(p, test_str))
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
['123', '235', '456', '910', '911', '912', '913', '915', '916']