Turn a string to a regexp
$ npm install --save regexpify
var regexpify = require('regexpify');
regexpify('');
//=> /.^/
regexpify('Rainbow');
//=> /Rainbow/
regexpify('how much $ for a unicorn?', true);
//=> /how much \$ for a unicorn\?/
MIT © Steve Mao