Is it necessary to use regex?
content ='12345 67890 123175 9876' for item in content.split(' '): if not item.endswith('175'): print(item)
Output
12345 67890 9876