Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template sub_match

boost::xpressive::sub_match — Class template sub_match denotes the sequence of characters matched by a particular marked sub-expression.

Synopsis

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

template<typename BidiIter> 
struct sub_match : public  {
  // types
  typedef       ;     
  typedef  ;
  typedef                            ;    
  typedef                               ;       

  // construct/copy/destruct
  ();
  (, ,  = );

  // public member functions
   () ;
  () ;
   () ;
  () ;
   () ;
   () ;
   (sub_match ) ;
   () ;

  // public data members
   matched;  // true if this sub-match participated in the full match. 
};

Description

When the marked sub-expression denoted by an object of type sub_match<> participated in a regular expression match then member matched evaluates to true, and members first and second denote the range of characters [first,second) which formed that match. Otherwise matched is false, and members first and second contained undefined values.

If an object of type sub_match<> represents sub-expression 0 - that is to say the whole match - then member matched is always true, unless a partial match was obtained as a result of the flag match_partial being passed to a regular expression algorithm, in which case member matched is false, and members first and second represent the character range that formed the partial match.

sub_match public construct/copy/destruct

  1. ();
  2. ( first,  second,  matched_ = );

sub_match public member functions

  1.  () ;
  2. () ;
  3.  () ;
  4. () ;
  5.  () ;
  6.  ( str) ;
    Performs a lexicographic string comparison.

    Parameters:

    str

    the string against which to compare

    Returns:

    the results of (*this).str().compare(str)

  7.  (sub_match  sub) ;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  8.  ( ptr) ;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


PrevUpHomeNext