import java.io.*; import java.math.*; import java.util.*; import java.util.regex.*; /** A simple text scanner which can parse primitive types and strings using regular expressions.

A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.

This class is based on a subset of the functionality of Sun's java.util.Scanner class from J2SE v1.5.0, with some code borrowed from the TextReader class written by Stuart Reges of the University of Washington. It should work with 'lazy input' from the keyboard as needed.

This implementation does not include the static factory Scanner.create methods as included in J2SE 1.5.0 beta 1.

Some notable differences from java.util.Scanner are the following:

Recent changes: