add word in match regex python code example
Example 1: re.add python
>>> import re
>>> text = 'Do you get it yet?'
>>> re.sub(r'(get)', r'\1@', text)
'Do you get@ it yet?'
Example 2: re.add python
import re
text = re.sub(r'(get)', r'\1@', text)