fork download
  1. import re
  2.  
  3. s = '''
  4. Heey yeah all the waay from heere
  5. '''
  6. def re_show(pat, s):
  7. print(re.compile(pat).sub("{\g<0>}", s.rstrip()))
  8.  
  9. re_show(r"(\w)\1", s)
Success #stdin #stdout 0.02s 9688KB
stdin
Standard input is empty
stdout
H{ee}y yeah a{ll} the w{aa}y from h{ee}re