XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (123 page)

The most useful properties that may be specified in the
\p
and
\P
constructs are described below; for a full list see Chapter 14.

Property
Meaning
L
All letters.
Lu
Uppercase letters, for example, A, B, Š, Σ.
Ll
Lowercase letters, for example, a, b, ñ, λ.
N
All numbers.
P
Punctuation (full stop, comma, semicolon, and so on).
Z
Separators (for example, space, newline, no-breaking space, en space, em space).
S
Symbols (for example, currency symbols, mathematical symbols, dingbats, and musical symbols).

Captured Groups

Within the

element, it is possible to refer to the substring that matched the regular expression as
.
, because it is provided as the context item. Sometimes, however, it is useful to be able to determine the strings that matched particular parts of the regular expression.

Any subexpression of the regular expression that is enclosed in parentheses causes the string that it matches to be available as a
captured group
. For example, if the regex
([0-9]+)([A-Z]+)([0-9]+)
is used to match the string
13DEC1987
, then the three captured groups will be
13
,
DEC
, and
1987
. If the regular expression were written instead as
([0-9]+)([A-Z]+([0-9]+))
, then the three captured groups would be
13
,
DEC1987

Other books

El Resurgir de la Fuerza by Dave Wolverton
The Earl and His Virgin Countess by Dominique Eastwick
Clockwiser by Elle Strauss
Johnny Cigarini by John Cigarini
The Light Between Oceans by M. L. Stedman
Freed by Tara Crescent
FireWolf by Viola Grace
The Scent of Blood by Tanya Landman