fork download
  1. import re
  2. p = re.compile(r'\b(?!(?:18|19|20)\d{2}\b)\d+\b')
  3. test_str = "Stack Overflow is a privately held website, the flagship site of the Stack Exchange Network, 4 5 6 created in 2008"
  4. print p.sub("", test_str)
Success #stdin #stdout 0.02s 9016KB
stdin
Standard input is empty
stdout
Stack Overflow is a privately held website, the flagship site of the Stack Exchange Network,    created in 2008