I have a string that looks like this:
the quick brown (error) fox jumps over (error) the lazy dog (error)
I want to output this string without "(error)", so I apply the following code:
str = str.replace(new RegExp('(\(error\))', 'g'),'');
However, after I run this code the string turns into this:
the quick brown () fox jumps over () the lazy dog ()
How do I get rid of those parenthesis and why are they not removed even though I escaped them and captured them?