Your regexp is /{0}/gi/{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/\\{0\\}/gi. You need to escape the escaping \\\ in the string.
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.
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.
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.