fork download
  1. import re
  2.  
  3.  
  4. def repl(m):
  5. return '' if re.search(r'[0-9]', m.group(0)) else m.group(0)
  6.  
  7.  
  8. out = re.sub(r'(\S+)', repl, 'one two2 three! four4')
  9. print(out)
  10.  
  11.  
Success #stdin #stdout 0.02s 9552KB
stdin
Standard input is empty
stdout
one  three!