Introduction

Syntax

Program Help

Examples

Download

Match Tool 2.1

Match Tool 3.0

 

MatchResult Class

Return: Content | Prev ReleaseString | Next: IsMatched


Summary

MatchResult class is used to record match result.

MatchResult object records the position of matched sub-string and captured sub-strings by groups.

To get substrings captured by named groups, get the group number first through  GetNamedGroupNumber , then get the position through the group number.


Members

IsMatched
     To get match result. Return non-zero if matched successfully.

GetStart
     Get the begin position of matched sub-string. Return negative value if match failed.

GetEnd
     Get the end position of matched sub-string. Return negative value if match failed.

GetGroupStart
     Get the start position of substring captured by group. Negative value if capture failed.

GetGroupEnd
     Get the end position of substring captured by group. Negative value if capture failed.

MaxGroupNumber
     Get the max group number of the regular expression.


Class Definition
class MatchResult
{
public:
    int IsMatched() const;

public:
    int GetStart() const;
    int GetEnd  () const;

public:
    int MaxGroupNumber() const;
    int GetGroupStart(int nGroupNumber) const;
    int GetGroupEnd  (int nGroupNumber) const;
};

 

 

RegExLab.com © 2005 - All Rights Reserved