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

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

Character Groups

A
character group
always appears within square brackets; it defines a set of permitted characters, and matches a single character from the input string if it is a member of that set. There are various ways the set of permitted characters can be defined, using the following syntax:

Construct
Syntax
charGroup
posCharGroup | negCharGroup | charClassSub
posCharGroup
( charRange | charClassEsc )+
negCharGroup

posCharGroup
charClassSub
( posCharGroup | negCharGroup )
-
charClassExpr

A character group is either a
positive group
, a
negative group
, or a
subtraction
. Examples of the three kinds are
[a-z]
,
[

0-9]
, and
[a-z-[pqr]]
.

A
positive group
(
posCharGroup
) consists of a sequence of one or more parts, each of which is either a
character range
or a
character class escape
. A positive group matches a character if any one of its parts matches the character. For example,
[a-zA-Z0-9%#]
matches any character that falls in one of the ranges
a
to
z
,
A
to
Z
, or
0
to
9
, as well as the
%

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

Other books

Facing Redemption by Kimberly McKay
Dead Weight by Susan Rogers Cooper
Star Struck by Amber Garza
Suspended In Dusk by Ramsey Campbell, John Everson, Wendy Hammer
Bayou Moon by Andrews, Ilona
Rua (Rua, book 1) by Kavi, Miranda