question: public String next ( Pattern pattern ) { checkOpen ( ) ; checkNotNull ( pattern ) ; matchSuccessful = false ; saveCurrentStatus ( ) ; if ( ! setTokenRegion ( ) ) { recoverPreviousStatus ( ) ; throw new NoSuchElementException ( ) ; } matcher . usePattern ( pattern ) ; if ( ! matcher . matches ( ) ) { recoverPreviousStatus ( ) ; throw new InputMismatchException ( ) ; } matchSuccessful = true ; return matcher . group ( ) ; }
target:  Returns the next token if it matches the specified pattern. The token will be both prefixed and suffixed by the delimiter that is currently being used (or a string that matches the delimiter pattern). This method will block if input is being read.