Hey, it’s a kind of magic.
chapter, we’ll discuss the API of
the classes in the new
package (see Figure 5-1).
JSR 51, the Java
Specification Request defining the new I/O
capabilities, also specifies the addition of regular expression
processing to the Java platform. While regular expressions, strictly
speaking, are not I/O, they are most commonly used
to scan text data read from files or streams.
You’ll learn how to use the new Java APIs to do the same powerful pattern matching that has been available to users of perl, egrep, and other text-processing tools. A detailed exploration of regular expression syntax is beyond the scope of this book, but a working familiarity with regular expressions is assumed. If you’re new to regular expressions, want to improve your skills, or are baffled by this chapter, I recommend you pick up a good reference. O’Reilly publishes an authoritative regular expression book (it’s even cited in the JDK documentation): Mastering Regular Expressions, by Jeffrey E. F. Friedl (http://www.oreilly.com/catalog/regex/).
A regular expression is a sequence of characters that describe, or express, a pattern of characters you are interested in matching within a target character sequence. Regular expressions have been widely available ...