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);
}

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 ) ; }
returns the next occurrence of the regular expression , stepping forward the tokenizer to the next line .
