So I have this string that says: My column name is Start Date (GMT).
What I want to do is replace the portion "Start Date (GMT)" with "start_date".
I've been attempting to achieve this using the following code:
let a= "My column name is Start Date (GMT)";
let b = "Start Date (GMT)";
let str = new RegExp(b,"g");
console.log(a.replace(str,"start_date"));
Interestingly, I can successfully replace the string with the desired value as long as there are no brackets involved. However, the presence of '(' seems to be causing an issue in identifying and replacing the string.