Javascript Regular Expressions not behaving the way I anticipate. For the below string, I wish to only capture the sub-string inside special chars '["' & '"]'. I'm not able to de-reference '["' & '"]' and having a problem with these special characters. How can I just select the sub-string of interest inside the delimeters?
let myStr = '{"ReportParameters":["This is for a special client."]}';
console.log(myStr);
var myRegexp = new RegExp("^.*\[\"(.*)\"\].*$", "g");
match = myRegexp.exec(myStr);
if (match != null) {
console.log(match[0])
}
This also does not work:
var myRegexp = /^.*\[(.*)\].*$"/g;