Literal Dollar Sign In A Regular Expression
I am working with Canada (fr-CA) locale and trying to do following: var str = '{1} '; var temp = ' '; str = str.replac
Solution 1:
$' has a special meaning in the replacement string when using JS regular expressions: it inserts the portion of the string that follows the matched substring. To get a literal dollar sign in the replacement string, use $$.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace.
Post a Comment for "Literal Dollar Sign In A Regular Expression"