In the replacement string, $1 returns what the first ... pair of parentheses captured. (You could use also \1 as you would in the pattern, but that usage is deprecated in the replacement. ...)
In reply to Re: regex question: $1 vs. \1
by mrbbking
in thread regex question: $1 vs. \1
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |