Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.
PrevUpHomeNext

Function BOOST_XPRESSIVE_GLOBAL_MARK_TAG

boost::xpressive::BOOST_XPRESSIVE_GLOBAL_MARK_TAG — Sub-match placeholder, like $1 in perl.

Synopsis

// In header: <boost/xpressive/regex_primitives.hpp>


 BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s1, 1);

Description

To create a sub-match, assign a sub-expression to the sub-match placeholder. For instance, (s1= _) will match any one character and remember which character was matched in the 1st sub-match. Later in the pattern, you can refer back to the sub-match. For instance, (s1= _) >> s1 will match any character, and then match the same character again.

After a successful regex_match() or regex_search(), the sub-match placeholders can be used to index into the match_results<> object to retrieve the Nth sub-match.


PrevUpHomeNext