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

Click here to view the latest version of this page.
PrevUpHomeNext

Global s1

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

Synopsis

unspecified s1;

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.

Copyright 2003, 2004 Eric Niebler

PrevUpHomeNext