vartoString=Object.prototype.toString;functionisRegExp(o){return'object'==typeofo&&'[object RegExp]'==toString.call(o);}module.exports=exports=function(regexp){if(!isRegExp(regexp)){thrownewTypeError('Not a RegExp');}varflags=[];if(regexp.global)flags.push('g');if(regexp.multiline)flags.push('m');if(regexp.ignoreCase)flags.push('i');returnnewRegExp(regexp.source,flags.join(''));}