nl_tokens: Create and cache a regular expression for matching file paths .
pl_tokens: function toRegex ( glob , options ) { // clone options to prevent  mutating the original object var opts = Object . create ( options || { } ) ; var flags = opts . flags || '' ; if ( opts . nocase && flags . indexOf ( 'i' ) === - 1 ) { flags += 'i' ; } var parsed = expand ( glob , opts ) ; // pass in tokens to avoid parsing more than once opts . negated = opts . negated || parsed . negated ; opts . negate = opts . negated ; glob = wrapGlob ( parsed . pattern , opts ) ; var re ; try { re = <mask> RegExp ( glob , flags ) ; return re ; } catch ( err ) { err . reason = 'micromatch invalid regex: (' + re + ')' ; if ( opts . strict ) throw new SyntaxError ( err ) ; } // we're only here if a bad pattern was used and the user // passed `options.silent`, so match nothing return / $^ / ; }