With Regex::Replace we can use $1, $2, ... to match corresponding groups. But how can I use $1 followed by number. E.g. to replace 6 with 678?
Regex::Replace(text, "(6)", '$178');
You need to use the alternate syntax:
Regex::Replace(text, "(6)", "${1}78");
It seems I can use $`
Regex::Replace(text, "(6)", '$1$`78');
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