Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

2 of 2
Improved illustration

Your regexp is /{0}/gi since you create it from a string. And it is not a valid expression. You need to escape { in the regexp because it has a special meaning in the regexp syntax, so it should be:

new RegExp('\\{'+i+'\\}', 'gi');

which is /\\{0\\}/gi. You need to escape the escaping \\ in the string.

AltStyle によって変換されたページ (->オリジナル) /