I have a regex pattern:
([0-9]*)xyz
I want to do the substitution as follows:
$10xyz
The problem is that $1- the capture group, but 0- this is just the number that I want to add to the substitution. But the regex thinks I'm asking for a capture group $10instead $1, and then after it is zero.
How can I refer to a capture group and immediately follow it with a number?
Using JavaScript in this case.
UPDATE As mentioned below, my code worked fine. The regular expression tester that I used was accidentally installed on PCRE instead of JavaScript.
source
share