#include <lib_regexpr.h>
A simple regular expression parser that supports '(', ')', '*', '|', ANY_CHAR and ANY_DIGIT characters.
Private Member Functions | |
| RegularExprParser () | |
Alloc/Free | |
| static RegularExprParser * | Alloc () |
| static void | Free (RegularExprParser *p) |
Expression | |
| Bool | Init (const String &strExprssion) |
| Bool | FindFirst (const String &strText, REGPARSEMODE mode, Bool bOnlyFirst, Int32 &lPos, String &strPattern) |
| Bool | FindNext (Int32 &lPos, String &strPattern) |
| void | CleanUp () |
|
private |
|
static |
|
static |
Initializes the parser with the regular expression strExprssion.
| [in] | strExprssion | The regular expression. |
| Bool FindFirst | ( | const String & | strText, |
| REGPARSEMODE | mode, | ||
| Bool | bOnlyFirst, | ||
| Int32 & | lPos, | ||
| String & | strPattern | ||
| ) |
Performs a search using the regular expression passed to Init() in the string strText, returning the first match in lPos and strPattern.
Use FindNext() to access further matches.
| [in] | strText | The text to search. |
| [in] | mode | The search mode: REGPARSEMODE |
| [in] | bOnlyFirst | If true then only one match is found, so further matches will not be returned by FindNext(). |
| [out] | lPos | Assigned the position of the first match. |
| [out] | strPattern | Assigned the text of the first match. |
Retrieves further matches after the one returned by FindFirst().
| [out] | lPos | Assigned the position of the match. |
| [out] | strPattern | Assigned the text of the match. |
| void CleanUp | ( | ) |
Cleans up the memory allocated by Init().