NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en: http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com.
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂ­tulo en concreto puede realizar una donación directa mediante Paypal:
Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)
Regular Expressions
Trail: Essential Classes
Lesson: Regular Expressions
This lesson explains how to use the java.util.regex API for pattern matching with regular expressions. Although the syntax accepted by this package is similar to the Perl programming language, knowledge of Perl is not a prerequisite. This lesson starts with the basics, and gradually builds to cover more advanced techniques.
Introduction
Provides a general overview of regular expressions. It also introduces the core classes that comprise this API.

Test Harness
Defines a simple application for testing pattern matching with regular expressions.

String Literals
Introduces basic pattern matching, metacharacters, and quoting.

Character Classes
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.

Quantifiers
Explains greedy, reluctant, and possessive quantifiers for matching a specified expression x number of times.

Capturing Groups
Explains how to treat multiple characters as a single unit.

Boundary Matchers
Describes line, word, and input boundaries.

Methods of 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.

Methods of the Matcher Class
Describes the commonly-used methods of the Matcher class.

Methods of the PatternSyntaxException Class
Describes how to examine a PatternSyntaxException.

Additional Resources
To read more about regular expressions, consult this section for additional resources.

Previous page: Previous Lesson
Next page: Introduction