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

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
12.47Mb size Format: txt, pdf, ePub

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

Stalemate by Iris Johansen
Countdown by Susan Rogers Cooper
A Rebel Captive by Thompson, J.D.
Her Last Love Affair by James, Clara
Mortal Desire by Alexander Bryn
First Frost by DeJesus, Liz
Dark on the Other Side by Barbara Michaels
Culinary Vietnam by Daniel Hoyer
Suspect Passions by V. K. Powell
Fridays at Enrico's by Don Carpenter