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 the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template before

boost::xpressive::before — Look-ahead assertion.

Synopsis

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


template<typename Expr> unspecified before(Expr const & expr);

Description

before(expr) succeeds if the expr sub-expression would match at the current position in the sequence, but expr is not included in the match. For instance, before("foo") succeeds if we are before a "foo". Look-ahead assertions can be negated with the bit-compliment operator.

Parameters:

expr

The sub-expression to put in the look-ahead assertion.

Notes:

before(expr) is equivalent to the perl (?=...) extension. ~before(expr) is a negative look-ahead assertion, equivalent to the perl (?!...) extension.


PrevUpHomeNext