ldas-tools-al
2.6.5
|
Regular Expression Match. More...
#include <regexmatch.hh>
Public Member Functions | |
RegexMatch (off_type nmatches=0) | |
Constructor. More... | |
~RegexMatch () | |
Destructor. | |
bool | match (const Regex &r, const char *string, flag_type eflags=0) |
Perform a Regex Match. More... | |
off_type | capacity () const |
off_type | size () const |
bool | isSubValid (off_type m) |
Check Substring Match Validity. More... | |
const char * | getSubStart (off_type m) |
Get Substring Start. More... | |
const char * | getSubEnd (off_type m) |
Get Substring End. More... | |
int | getSubStartOffset (off_type m) |
Get Substring Starting Offset. More... | |
int | getSubEndOffset (off_type m) |
Get Substring Ending Offset. More... | |
off_type | getSubLength (off_type m) |
Get Substring Length. More... | |
std::string | getSubString (off_type m) |
Get Substring. More... | |
off_type | getNMatches () const |
Get Number of Matches. More... | |
Regular Expression Match.
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).
RegexMatch::RegexMatch | ( | off_type | nmatches = 0 | ) |
Constructor.
nmatches |
|
inline |
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.
|
inline |
Get Number of Matches.
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.
|
inline |
Get Substring End.
Returns a pointer to the end of a substring match. If the requested match is not valid, a null pointer is returned.
m |
|
inline |
Get Substring Ending Offset.
Returns the offset to the end of a substring match. If the requested match is not valid, then -1 is returned.
m |
|
inline |
Get Substring Length.
Returns the number of characters in a substring match.
m |
|
inline |
Get Substring Start.
Returns a pointer to the beginning of a substring match. If the requested match is not valid, a null pointer is returned.
m |
|
inline |
Get Substring Starting Offset.
Returns the offset to the beginning of a substring match. If the requested match is not valid, then -1 is returned.
m |
std::string RegexMatch::getSubString | ( | off_type | m | ) |
Get Substring.
Return a substring as a C++ string object.
m | Index of match starting from zero. |
|
inline |
Check Substring Match Validity.
This returns whether or not a substring match exists at the specified index.
m |
bool RegexMatch::match | ( | const Regex & | r, |
const char * | string, | ||
flag_type | eflags = 0 |
||
) |
Perform a Regex Match.
r | Precompiled pattern buffer |
string | Text string containing the input text |
eflags | flag which cause changes in matching behavior
|
|
inline |
Returns the number of matches that were found after the call to match()