question: public Token nextRegex ( Pattern pattern ) { if ( ! hasNextRegex ( pattern ) ) throw new IllegalStateException ( "No more occurrences found!" ) ; Matcher matcher = anyMentionPattern . matcher ( remaining ) ; if ( ! matcher . find ( ) ) throw new IllegalStateException ( "Couldn't find any matches!" ) ; final int start = currentPosition + matcher . start ( ) ; final int end = currentPosition + matcher . end ( ) ; stepTo ( end ) ; return new Token ( this , start , end ) ; }
target:  Returns the next occurrence of the regular expression, stepping forward the tokenizer to the next line.