<< Description >>
Xpressive allows you to write your regular expressions as strings to be
parsed at runtime, or as expression templates parsed at compile time.
Regular expressions can nest and call each other recursively, giving
them the power of context free grammars. Xpressive's interface follows
the regex standardization proposal fairly closely.
Xpressive has been accepted into Boost and will be part of the next
major Boost release. It is available today as a separate download that
requires Boost v1.32 or higher.
<< Download >>
You can get Xpressive from the Boost File Vault here:
http://tinyurl.com/gjzap
<< Documentation >>
The documentation is available in PDF format in the Xpressive download
and in HTML format here:
http://tinyurl.com/m5heu
<< License >>
Xpressive is freely available for all uses under the terms of the Boost
Software License: http://www.boost.org/LICENSE_1_0.txt.
<< FAQ >>
Q: How does Boost.Xpressive differ from Boost.Regex?
A: Although Xpressive's primitives are regex-ish in nature, Xpressive is
more powerful than ordinary regex engines. By allowing you to embed one
pattern in another by reference, Xpressive lets you find patterns in
data that are recursive in nature. Problems that are intractable with
"classic" regular expressions, such as matching balanced nested
parentheses or matching XML tags, are simple with Xpressive. So
Xpressive is more rightly thought of as a context-free grammar engine
with exhaustive backtracking.
The goal is to provide one framework and one set of pattern matching
primitives that scales from simple strstr-style grepping, through
ordinary regexing, all the way to full-blown parsing.
Grep happy,
--
Eric Niebler
Boost Consulting
www.boost-consulting.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
> A: Although Xpressive's primitives are regex-ish in nature, Xpressive is
> more powerful than ordinary regex engines. By allowing you to embed one
> pattern in another by reference, Xpressive lets you find patterns in
> data that are recursive in nature. Problems that are intractable with
> "classic" regular expressions, such as matching balanced nested
> parentheses or matching XML tags, are simple with Xpressive. So
> Xpressive is more rightly thought of as a context-free grammar engine
> with exhaustive backtracking.
PCRE can handle recursivity too, with (?R).
PCRE's (?R) can only invoke the *current* regex recursively. With
xpressive, you can invoke *other* regexes. That makes it possible to
build grammars out of them. PCRE can't do that. (Perl is moving in that
direction. See: http://www.perl.com/pub/a/2002/06/04/apo5.html)
--
Eric Niebler
Boost Consulting
www.boost-consulting.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]