nl_tokens: Create the regex to do the matching . If the leading character in the pattern is ! a negation regex is returned .
pl_tokens: function toRegex ( pattern , contains , isNegated ) { var prefix = contains ? '^' : '' ; var after = contains ? '$' : '' ; pattern = ( '(?:' + pattern + ')' + after ) ; if ( isNegated ) { pattern = prefix + negate ( pattern ) ; } return new RegExp ( prefix + <mask> ) ; }