fork(1) download
  1. import re
  2. str = 'This is number 1 and this is number 22'
  3. pat = r'\d+'
  4. repl = r'"\g<0>"'
  5. print(re.sub(pat, repl, str))
Success #stdin #stdout 0.01s 28384KB
stdin
Standard input is empty
stdout
This is number "1" and this is number "22"