My questions is how can I use regex sub in a way that the substituted substring is obtained by mutating the matched part? Let me explain if original string is "The most comment log in coding is Hello World" then the modified string should be "The1 most comment log in coding is Hello1 World1"
lets say regex is r'[A-Z][a-z]+'
How can I add something after or importantly in-between each match?
Please help me out here
I have tried regex sub, split etc