Name
xs:pattern
Synopsis
<xs:pattern id = "ID
" value = "regular expression
" > <!-- (xs:annotation?) --> </xs:pattern>
The xs:pattern
facet
element is used to derive new simple types by specifying a regular
expression against which values of the type are compared. It
applies to all simple types. The schema regular-expression grammar is quite similar
to that used in Perl 5.6 and later. (The big change from earlier
versions of Perl is support for Unicode character class-based
regular expressions.) Most strings and characters match
themselves, but a few characters have special meanings, as
summarized in Table
22-1. In this table, A
and
B
are subexpressions;
n
and m
are
nonnegative integers; a
,
b
, c
, and
d
are all single Unicode characters;
and X
is a name.
Pattern | Matches |
| A string that matches
|
| A string that matches
|
| A string that matches
|
| Zero or one repetitions of a string that
matches |
| Zero or more repetitions of a string that
matches |
| One or more repetitions of a string that
matches |
| A sequence of between
|
| A sequence of exactly
|
| A sequence of at least
|
| Exactly one of the characters listed inside the square brackets |
| Exactly one character not listed inside the square brackets |
|
Get XML in a Nutshell, 3rd Edition 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.