cxxtools::RegexSMatch Class Reference

collects matches in a regex More...

#include <cxxtools/regex.h>

Public Member Functions

 RegexSMatch ()
unsigned size () const
 returns the number of expressions, which were found
regoff_t offsetBegin (unsigned n) const
 returns the start position of the n-th expression
regoff_t offsetEnd (unsigned n) const
 returns the end position of the n-th expression
regoff_t size (unsigned n) const
 returns the size of the n-th expression
bool has (unsigned n) const
 returns true if the n-th element is set.
std::string get (unsigned n) const
 returns the n-th element. No range checking is done.
std::string format (const std::string &s) const
 replace each occurence of "$n" with the n-th element (n: 0..9).
std::string operator[] (unsigned n) const
 returns the n-th element. No range check is done.

Friends

class Regex

Detailed Description

collects matches in a regex

Constructor & Destructor Documentation

cxxtools::RegexSMatch::RegexSMatch ( )
inline

Member Function Documentation

std::string cxxtools::RegexSMatch::format ( const std::string &  s) const

replace each occurence of "$n" with the n-th element (n: 0..9).

std::string cxxtools::RegexSMatch::get ( unsigned  n) const

returns the n-th element. No range checking is done.

bool cxxtools::RegexSMatch::has ( unsigned  n) const
inline

returns true if the n-th element is set.

regoff_t cxxtools::RegexSMatch::offsetBegin ( unsigned  n) const
inline

returns the start position of the n-th expression

regoff_t cxxtools::RegexSMatch::offsetEnd ( unsigned  n) const
inline

returns the end position of the n-th expression

std::string cxxtools::RegexSMatch::operator[] ( unsigned  n) const
inline

returns the n-th element. No range check is done.

unsigned cxxtools::RegexSMatch::size ( ) const

returns the number of expressions, which were found

regoff_t cxxtools::RegexSMatch::size ( unsigned  n) const
inline

returns the size of the n-th expression

Friends And Related Function Documentation

friend class Regex
friend

The documentation for this class was generated from the following file: