Doxygen
|
Object representing the matching results. 更多...
#include <regex.h>
Public 成员函数 | |
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 成员函数 | |
void | init (const std::string *str) |
void | startCapture (size_t index) |
void | endCapture (size_t index) |
void | setMatch (size_t pos, size_t len) |
Private 属性 | |
std::vector< SubMatch > | m_subMatches |
size_t | m_captureIndex =0 |
const std::string * | m_str = nullptr |
bool | m_insideCapture =false |
友元 | |
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 |
Returns the position of the match or std::string::npos if no length is set.
引用了 m_str, position() , 以及 reg::SubMatch::setMatch().
被这些函数引用 reg::Iterator::operator*().
|
inline |
Returns the n-th SubMatch object.
Note that there is always 1 SubMatch object representing the whole match.
引用了 m_captureIndex , 以及 m_subMatches.
|
inline |
Returns the position of the match or std::string::npos if no position is set.
引用了 m_str.
被这些函数引用 length() , 以及 reg::Iterator::operator*().
|
inline |
|
inlineprivate |
|
inline |
|
inlineprivate |
引用了 m_captureIndex, m_insideCapture , 以及 m_subMatches.
|
inline |
Return a string representing the matching part.
|
inline |
|
private |
被这些函数引用 operator[]() , 以及 startCapture().
|
private |
被这些函数引用 startCapture().
|
private |
被这些函数引用 length() , 以及 position().
|
private |
被这些函数引用 operator[](), prefix(), startCapture() , 以及 suffix().