JavaScript: Regex Replacement String Dollar Sign Sequence
When using regex, the following dollar sign sequence have special meaning in the replace string.
This is used by:
$n
- nth captured match. (n is a positive integer less than 100)
$<name>
- refers to named capture name.
$&
- the matched string.
$`
- the string before the matched string.
$'
- the string after the matched string.
$$
- literal dollar sign character.
JavaScript Regular Expression
- RegExp Tutorial
- RegExp Functions
- RegExp Syntax
- RegExp Flag
- Replacement String Dollar Sign Sequence
- Replacement Function Arguments