var badCode = "\(INST1,\\[0,";
var regex = new RegExp(badCode, "igm");
gets the error "unterminated character class".
How to fix?
TIA
Having tried the suggestions from the respondents for this post, look at the following screenshots (you may need to right-click on the images and open in a new tab to make it legible): check the values โโof new_bad_thing (equiv of badCode above)

and here is the screen print when I press the start button (note the error message):

source
share