Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-11-12 04:37:57


hallouina-ml_at_[hidden] wrote:
> Hello everybody,
>
> I begin with C++ and need to use some regex in my program. So I try to
> compile this example from the boost website :
>
> http://www.boost.org/libs/regex/example/snippets/captures_example.cpp
>
> but I get this error :
>
> ~/developpement/essai_regex/boost$ g++ -o test captures_examples.cpp

There are two issues here: in order to use that specific feature you need to
compile both your code and the regex library with BOOST_REGEX_MATCH_EXTRA
defined (this isn't the case for any of the other examples). You also need
to specify the regex library to link against, so usually:

g++ -o test -DBOOST_REGEX_MATCH_EXTRA=1 captures_examples.cpp -lboost_regex

See the "repeated captures" section of the docs
http://svn.boost.org/svn/boost/trunk/libs/regex/doc/html/boost_regex/captures.html#boost_regex.captures.repeated_captures
for more information on this still-experimental repeated-capture feature.

Also note that you *do not* need to turn this feature on to be able to use
regular Perl or POSIX style captures.

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net