One word needs to be replace in long string:
var str=<long string>;
var newValue = "`" + <input from user> + "`";
var regexValue = new RegExp(oldValue, 'g');
str = str.replace(regexValue, newValue);
How is the best way to handle special characters? I have an input field in HTML which I can assign some regex.
Current problem,
When the new value is "table_?" the regex fails after that. This is just one case but there are other special characters which need to be handled. There is no other restriction on the input field.