Jac*_*ack 1 javascript regex replace
为什么这段代码不能正常工作?
var temp = "@TEMP (A1)"
var text = "1st Oct @TEMP (A1)"
text = text.replace(new RegExp(temp, "gi"), "");
console.log(text); //I get same text even though I used replace instead of 1st Oct??
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释这里出了什么问题吗?