nl_tokens: Act like a multi - character <code > eat< / code > —if <code > consume< / code > is true or not given—or a look - ahead that doesn t update the stream position—if it is false . <code > pattern< / code > can be either a string or a regular expression starting with ^ . When it is a string <code > caseInsensitive< / code > can be set to true to make the match case - insensitive . When successfully matching a regular expression the returned value will be the array returned by <code > match< / code > in case you need to extract matched groups .
pl_tokens: function ( pattern , consume , caseInsensitive ) { if ( typeof pattern == "string" ) { var cased = caseInsensitive ? function ( str ) { return str . toLowerCase ( ) ; } : function ( str ) { return str ; } ; if ( cased ( this . string ) . indexOf ( cased ( pattern ) , this . <mask> ) == this . pos ) { if ( consume !== false ) this . pos += pattern . length ; return true ; } } else { var match = this . string . slice ( this . pos ) . match ( pattern ) ; if ( match && consume !== false ) this . pos += match [ 0 ] . length ; return match ; } }