This section teaches the regular expression syntax supported by the
java.util.regex API and presents several working examples to illustrate how the various objects interact.
Introducing Regular Expressions
Introducing regular expressions: what are they and what you can do with them. Includes the code used to test regular expressions, used throughout this section.
Introduces basic pattern matching, metacharacters, and quoting.
Describes simple character classes, negation, ranges, unions, intersections, and subtraction.
Predefined Character Classes
Describes the basic predefined character classes for whitespace, word, and digit characters.
Explains greedy, reluctant, and possessive quantifiers for matching a specified expression x number of times.
Explains how to treat multiple characters as a single unit.
Describes line, word, and input boundaries.
The Pattern Class
Examines other useful methods of the Pattern class, and explores advanced features such as compiling with flags and using embedded flag expressions.
The Matcher Class
Describes the commonly-used methods of the Matcher class.
Methods of the PatternSyntaxException Class
Describes how to examine a PatternSyntaxException.