>>> import re >>> text = 'Do you get it yet?' >>> re.sub(r'(get)', r'1@', text) 'Do you get@ it yet?'