import rep = re.compile(r'\b(?!914)\d{3}\b')test_str = "123\n235\n456\n1000\n910 911 912 913\n 914\n915 916"print(re.findall(p, test_str))
Standard input is empty
['123', '235', '456', '910', '911', '912', '913', '915', '916']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!