Class Index Cross Index Namespace Index

Class RegexMatch

Regular Expression Match
Contained in: global
Derived from: none
Derived by: none

#include "general/regexmatch.hh"


public function member index:

RegexMatch(size_t nmatches = 0) throw (std::bad_alloc);
~RegexMatch() throw ( );
inline size_t getNMatches() const throw ( ); Get Number of Matches
inline const char* getSubEnd(size_t m) throw ( ); Get Substring End
inline int getSubEndOffset(size_t m) throw ( ); Get Substring Ending Offset
inline size_t getSubLength(size_t m) throw ( ); Get Substring Length
inline const char* getSubStart(size_t m) throw ( ); Get Substring Start
inline int getSubStartOffset(size_t m) throw ( ); Get Substring Starting Offset
std::string getSubString(size_t m) throw ( );
inline bool isSubValid(size_t m) throw ( ); Check Substring Match Validity
bool match(const Regex& r, const char* string, int eflags = 0) throw ( );
 

Description:

This class represents a regular expression match. It attempts to match a string with a regular expression, storing the information resulting from captures (the parenthesis expressions).


Function Member Descriptions:


RegexMatch::RegexMatch


RegexMatch(size_t nmatches = 0) throw (std::bad_alloc);



RegexMatch::~RegexMatch


~RegexMatch() throw ( );



RegexMatch::getNMatches - Get Number of Matches


inline size_t getNMatches() const throw ( );
Returns the maximum number of matches which this object can hold. This is equal to the number of matches which was passed to the constructor.

Return value:
size_t


RegexMatch::getSubEnd - Get Substring End


inline const char* getSubEnd(size_t m) throw ( );
Returns a pointer to the end of a substring match. If the requested match is not valid, a null pointer is returned.

Parameters:
ParameterDescription
size_t m

Return value:
const char*


RegexMatch::getSubEndOffset - Get Substring Ending Offset


inline int getSubEndOffset(size_t m) throw ( );
Returns the offset to the end of a substring match. If the requested match is not valid, then -1 is returned.

Parameters:
ParameterDescription
size_t m

Return value:
const char*


RegexMatch::getSubLength - Get Substring Length


inline size_t getSubLength(size_t m) throw ( );
Returns the number of characters in a substring match.

Parameters:
ParameterDescription
size_t m

Return value:
size_t


RegexMatch::getSubStart - Get Substring Start


inline const char* getSubStart(size_t m) throw ( );
Returns a pointer to the beginning of a substring match. If the requested match is not valid, a null pointer is returned.

Parameters:
ParameterDescription
size_t m

Return value:
const char*


RegexMatch::getSubStartOffset - Get Substring Starting Offset


inline int getSubStartOffset(size_t m) throw ( );
Returns the offset to the beginning of a substring match. If the requested match is not valid, then -1 is returned.

Parameters:
ParameterDescription
size_t m

Return value:
const char*


RegexMatch::getSubString


std::string getSubString(size_t m) throw ( );



RegexMatch::isSubValid - Check Substring Match Validity


inline bool isSubValid(size_t m) throw ( );
This returns whether or not a substring match exists at the specified index.

Parameters:
ParameterDescription
size_t m

Return value:
bool


RegexMatch::match


bool match(const Regex& r, const char* string, int eflags = 0) throw ( );



Variable Member Descriptions:


RegexMatch::mMatches -

regmatch_t* mMatches;

RegexMatch::mNMatches -

size_t mNMatches;

RegexMatch::mString -

const char* mString;