본문 바로가기
✘✘✘ Javascript

[javascript] replace with Regex, $n vs $&

by PrettyLog 2023. 5. 9.

The $& and $1 are not the same.

$& is a back reference to the whole match.
$1 is a back reference to the submatch captured with capturing

ref

댓글