I have what I think are the same expressions one in the sorthand regex format, the other as a RegExp object with a string. I expect they would both be true but that's not what I'm seeing.
/^key$|^key([;,]\skey)+$/.test('key, key; key') //true
var rgxStr = '^key$|^key([;,]\skey)+$'; //
(new RegExp(rgxStr)).test('key, key; key'); //false
What is going on?