Doxygen
|
Object representing the matching results. More...
#include <src/regex.h>
Public Member Functions | |
Match () | |
Creates an empty match object. | |
size_t | position () const |
Returns the position of the match or std::string::npos if no position is set. | |
size_t | length () const |
Returns the position of the match or std::string::npos if no length is set. | |
std::string | str () const |
Return a string representing the matching part. | |
SubMatch | prefix () const |
Return the part of the string before the match. | |
SubMatch | suffix () const |
Return the part of the string after the match. | |
size_t | size () const |
Returns the number of sub matches available in this match. | |
const SubMatch & | operator[] (size_t index) const |
Returns the n-th SubMatch object. |
Private Member Functions | |
void | init (std::string_view str, size_t captureCount) |
void | startCapture (size_t groupId, size_t index) |
void | endCapture (size_t groupId, size_t index) |
void | setMatch (size_t pos, size_t len) |
Private Attributes | |
std::vector< SubMatch > | m_subMatches |
std::string_view | m_str |
Friends | |
class | Ex |
Object representing the matching results.
It consists of an array of SubMatch objects. The first entry of the array represents the whole match, any next elements represent each of the capture ranges.
For example string @42 and expression @(\\d+) will have two Submatches, match[0] will point to the input string as a whole, and match[1] will point to the number 42 only.
|
inline |
|
inlineprivate |
Definition at line 207 of file regex.h.
References m_subMatches, and position().
|
inlineprivate |
Definition at line 190 of file regex.h.
References m_str, m_subMatches, and str().
Referenced by reg::Ex::Private::matchAt().
|
inline |
Returns the position of the match or std::string::npos if no length is set.
Definition at line 160 of file regex.h.
References m_subMatches.
Referenced by addValidAliasToMap(), reg::Ex::Private::matchAt(), and suffix().
|
inline |
Returns the n-th SubMatch object.
Note that there is always 1 SubMatch object representing the whole match.
Definition at line 186 of file regex.h.
References m_subMatches.
|
inline |
Returns the position of the match or std::string::npos if no position is set.
Definition at line 157 of file regex.h.
References m_subMatches.
Referenced by addValidAliasToMap(), endCapture(), reg::Ex::Private::matchAt(), prefix(), and suffix().
|
inline |
Return the part of the string before the match.
Definition at line 166 of file regex.h.
References m_str, position(), and reg::SubMatch::setMatch().
|
inlineprivate |
Definition at line 217 of file regex.h.
References m_subMatches.
|
inline |
Returns the number of sub matches available in this match.
Definition at line 181 of file regex.h.
References m_subMatches.
Referenced by addValidAliasToMap(), and reg::Ex::Private::matchAt().
|
inlineprivate |
Definition at line 200 of file regex.h.
References m_subMatches.
|
inline |
Return a string representing the matching part.
Definition at line 163 of file regex.h.
References m_subMatches.
Referenced by addValidAliasToMap(), init(), and initPredefined().
|
inline |
Return the part of the string after the match.
Definition at line 169 of file regex.h.
References length(), m_str, position(), and reg::SubMatch::setMatch().
|
private |
|
private |
Definition at line 223 of file regex.h.
Referenced by endCapture(), init(), length(), operator[](), position(), setMatch(), size(), startCapture(), and str().