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

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
6.64Mb size Format: txt, pdf, ePub
  • When there are two alternatives that both match at the same position in the input string, the first alternative is preferred, regardless of its length. For example, given the input
    size=5.2
    , the regular expression
    [0-9]+|[0-9]*\.[0-9]*
    will match
    5
    rather than
    5.2
    .

Regular Expression Syntax

The regular expression syntax accepted in the
regex
attribute is the same as that accepted by the
match()
,
tokenize()
, and
replace()
functions, and it is fully described in Chapter 14. This section provides a quick summary only; it makes no attempt to define details such as precedence rules.

The following table summarizes the more important constructs found in a regex. In this summary, capital letters A and B represent arbitrary regular expressions. n and m represent a number (a sequence of digits). a, b, c represent an arbitrary character, which is either a normal character, or one of the metacharacters
.
,
\
,
?
,
*
,
+
,
{
,
}
,
(

Other books

Finding Hope in Texas by Ryan T. Petty
The Reservoir by Naramore, Rosemarie
Crazy for Love by Victoria Dahl
Satan’s Lambs by Lynn Hightower
02 Seekers by Lynnie Purcell
Karate Katie by Nancy Krulik
Hit: A Thriller (The Codename: Chandler) by Konrath, J.A., Peterson, Ann Voss, Kilborn, Jack
Whispers on the Wind by Judy Griffith Gill