var badCode = "\(INST1,\\[0,";
var regex = new RegExp(badCode, "igm");
gets "unterminated character class" error.
How to fix?
TIA
trying suggestions from responders to this post, please see the following screen prints (you might have to right-click on images and open in new tab to make legible):
note values of new_bad_thing (equiv of badCode above)

and here is the screen print when I hit the run button (please note the error message):

SyntaxError: Invalid regular expression: /(INST1,\[0,/: Unterminated group, i.e. the parenthesis (char 1 in string) doesn't have a matching). It is being treated as a group as"\(" === "(", you need to write"\\("to get\(.