The Scanner next() method reads the next word.
But the default meaning of word is whitespace delimited sequence of input characters.
The delimiter pattern can be changed using Scanner's useDelimiter method.
The argument to useDelimiter should be string representing a pattern. Then any sequences of characters that match the pattern will be treated as the delimiter to use in determining the words by the Scanner.
Patterns are spcified by regular expressions