更新时间:2023-02-22 13:53:18
在构建字符串时,RegExp表达式构建器中的\被视为转义字符,就像在实际的RegExp中一样。您需要转义两次,尝试:
The "\" in the RegExp expression builder is treated as an escape character when building the string, just as it is in the actual RegExp. You need to escape twice, try:
new RegExp('\\$'+placeholdername+'\\$');