JS: Regex Replace String Dollar Sign
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
- JS: RegExp Tutorial
- JS: Regex Functions
- JS: RegExp Syntax
- JS: RegExp Flag
- JS: Regex Replace String Dollar Sign
- JS: Regex Replace Function Args
- JS: RegExp Object
- JS: RegExp Constructor
- JS: RegExp.prototype
- JS: String.prototype.search
- JS: String.prototype.match
- JS: String.prototype.matchAll
- JS: String.prototype.replace
- JS: String.prototype.replaceAll
- JS: RegExp.prototype.test
- JS: RegExp.prototype.exec