|
Public Methods |
| FXRex () |
| Construct empty regular expression object.
|
| FXRex (const FXRex &orig) |
| Copy regular expression object.
|
| FXRex (const FXchar *pattern, FXint mode=REX_NORMAL, FXRexError *error=NULL) |
| Compile expression from pattern; if error is not NULL, error code is returned.
|
| FXRex (const FXString &pattern, FXint mode=REX_NORMAL, FXRexError *error=NULL) |
| Compile expression from pattern; if error is not NULL, error code is returned.
|
FXRex & | operator= (const FXRex &orig) |
| Assign another regular expression to this one.
|
FXbool | empty () const |
FXRexError | parse (const FXchar *pattern, FXint mode=REX_NORMAL) |
| Parse pattern, return error code if syntax error is found.
|
FXRexError | parse (const FXString &pattern, FXint mode=REX_NORMAL) |
| Parse pattern, return error code if syntax error is found.
|
FXbool | match (const FXchar *string, FXint len, FXint *beg=NULL, FXint *end=NULL, FXint mode=REX_FORWARD, FXint npar=1, FXint fm=0, FXint to=2147483647) const |
FXbool | match (const FXString &string, FXint *beg=NULL, FXint *end=NULL, FXint mode=REX_FORWARD, FXint npar=1, FXint fm=0, FXint to=2147483647) const |
| Search for match in a string.
|
| ~FXRex () |
| Delete.
|
Static Public Methods |
FXString | substitute (const FXchar *string, FXint len, FXint *beg, FXint *end, const FXString &replace, FXint npar=1) |
FXString | substitute (const FXString &string, FXint *beg, FXint *end, const FXString &replace, FXint npar=1) |
| Return substitution string.
|
const FXchar * | getError (FXRexError err) |
| Returns error code for given error.
|
Friends |
FXAPI FXbool | operator== (const FXRex &r1, const FXRex &r2) |
| Comparison operators.
|
FXAPI FXbool | operator!= (const FXRex &r1, const FXRex &r2) |
FXAPI FXStream & | operator<< (FXStream &store, const FXRex &s) |
| Saving and loading.
|
FXAPI FXStream & | operator>> (FXStream &store, FXRex &s) |
When parsing a regular expression pattern, the mode parameter is the bitwise OR of a set of flags and affects the match algorithm. Passing the flag REX_CAPTURE enables capturing parentheses and back references. The flag REX_ICASE enables case-insensitive matching. When the flag REX_NEWLINE is passed, newlines are treated like normal characters; otherwise, newline is NOT matched except when explicitly part of a character class. The flag REX_VERBATIM disables all special character interpretation.
When matching a compiled pattern, the mode parameter is the bitwise OR of a set of flags that affects how the match is performed. Passing the flag REX_BACKWARD causes the match to proceed backwards through the subject string. Passing the flags REX_NOT_BOL and/or REX_NOT_EOL causes the begin and end of the subject string NOT to be considered a line start or line end. The flag REX_NOT_EMPTY causes a match to fail if the empty string was matched.