fork download
  1. import re
  2. strs = ['1/26/2009through', 'through1/26/2009']
  3. for s in strs:
  4. res = re.sub(r'\d{1,2}([/,:])\d{1,2}\1\d{2}(?:\d{2})?', '', s)
  5. print("{} => {}".format(s, res))
Success #stdin #stdout 0.02s 6944KB
stdin
Standard input is empty
stdout
1/26/2009through => through
through1/26/2009 => through