Let's say I want to add a 0
after every word
(\w+)
The following replacement string doesn't work.
$10
So, how do I convert
this is my string
into
this0 is0 my0 string0
Use braces around the group ID in the replacement string:
${1}0
The braces tell the regex engine that the number inside them is the actual Group ID. The 0
that will follow will be treated as a literal zero.
BTW, you can also get the same result with \w+
regex and ${0}0
replacement string, no need in capturing groups.
Or, using \n
syntax, it works like this:
Find: (\w+)
Replace: \10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With