이 코드가 정상적으로 작동하지 않는 이유는 무엇입니까?Javascript replace 함수가 regexp와 작동하지 않습니다.
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??
여기서 어떤 문제가 발생하는지 설명 할 수 있습니까?
var temp = "@TEMP \\(A1\\)"