fork(1) download
  1. import re
  2.  
  3.  
  4. r = re.compile(r'hello|world')
  5.  
  6.  
  7. string = 'hello world the World!!'
  8.  
  9. print(re.sub(r, 'fuck', string))
  10.  
  11.  
Success #stdin #stdout 0.02s 8736KB
stdin
Standard input is empty
stdout
fuck fuck the World!!