This chapter explains how to use the
java.util.regex1 API for pattern matching with regular expressions. Although the syntax accepted by this package is similar to the Perl2 programming language, knowledge of Perl is not a prerequisite. This chapter starts with the basics, and gradually builds to cover more advanced techniques.
The introductory section provides a general overview of regular expressions. It also introduces the core classes that comprise this API.
The other sections do the following:
• Define a simple application for testing pattern matching with regular expressions.
• Introduce basic pattern matching, metacharacters, and quoting.
• Describe simple character classes, negation, ranges, unions, intersections, ...