I have a working example here: http://jsfiddle.net/R7KuK/
I\'ve tried to create an array containing full regular expressions with regex delimiters and set flags, but the
Try this:
var regexSplit = regex.split( '/' );
var realRegex = new RegExp( regexSplit[1], regexSplit[2] );
Or better:
var regexMatch = regex.match( /^\/(.*)\/([^\/]*)$/ );
var realRegex = new RegExp( regexMatch[1], regexMatch[2] );
Better cause if your regex contains '/', the first one will fail. ;)