14.2. Regular Expression Syntax

A regular expression is a set of characters that represents a pattern. Many instance strings may match the pattern identified by the regular expression. Any set of characters in a regular expression may be required, repeated, optional, or otherwise controlled. Because of this flexibility, the number of strings that match a regular expression is potentially unbounded.

14.2.1. Metacharacters

A regular expression has a number of special characters, or metacharacters, that generally denote groupings or repetition. Table 14.1 describes these metacharacters.

Table 14.1. Metacharacter Examples
Metacharacter Description Sample Regular Expression Match Sample
. Match any character as defined by The Unicode Standard.

Get XML Schema Complete Reference, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.