Escaping $ in Replace Strings in Javascript

Comments

To have a $ in your replace strings in Javascript regular expressions, it needs to be escaped with another $

I.e., $$, not \$. In other words, the escape character for the RegExp “language” is $, even within Javascript, not the standard slash .

Comments