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
10.05Mb size Format: txt, pdf, ePub
ads

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

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

Other books

Downriver by Iain Sinclair
Melindas Wolves by GW/Taliesin Publishing
Naked Disclosure by Michele Bardsley
Girls Out Late by Jacqueline Wilson
M&L03 - SS by Stacie Simpson
The Magician's Boy by Susan Cooper
Correcting the Landscape by Marjorie Kowalski Cole
Wicked Wyckerly by Patricia Rice