var re = "^abc";
How to create a RegEx from this variable to be able to test some strings with it like this:
/THE_re_VARIABLE_HERE/i.test( someString );
You'll have to use the class constructor:
var re = "^abc";
new RegExp( re, 'i' ).test( someString );
You can use RegExp method:
var re = "^abc";
new RegExp(re,'i').test( someString );