I assume these two are equivalent:
let pattern1 = /\((.?)*\)/g;
let pattern2 = new RegExp('\((.?)*\)', 'g');
but they produce different results when applied on the following string:
let str = 'abc(a, b);'
let result1 = str.match(pattern1);
let result2 = str.match(pattern2);
Why?