Javascript replace method, replace with “$1”
Each pair of parentheses (…) where the first character is not a ?* is a “capturing group”, which places its result into $1,$2,$3,etc which can be used in the replacement pattern. You might also see the same thing as \1,\2,\3 in other regex engines, (or indeed in the original expression sometimes, for repetition) These are … Read more