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 repeat

boost::xpressive::repeat — Repeat a sub-expression multiple times.

Synopsis

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


template<unsigned int Min, unsigned int Max, typename Expr> 
  unspecified repeat(Expr const & expr);
template<unsigned int Count, typename Expr2> 
  unspecified repeat(Expr2 const & expr2);

Description

There are two forms of the repeat<>() function template. To match a sub-expression N times, use repeat<N>(expr). To match a sub-expression from M to N times, use repeat<M,N>(expr).

The repeat<>() function creates a greedy quantifier. To make the quantifier non-greedy, apply the unary minus operator, as in -repeat<M,N>(expr).

Parameters:

expr

The sub-expression to repeat.


PrevUpHomeNext