#include <pstring.h>
Inheritance diagram for PRegularExpression:
Constructors & destructors | |
enum | { Extended = 1, IgnoreCase = 2, AnchorNewLine = 4 } |
Flags for compiler options. More... | |
enum | { NotBeginningOfLine = 1, NotEndofLine = 2 } |
Flags for execution options. More... | |
PRegularExpression () | |
Create a new, empty, regular expression. | |
PRegularExpression (const PString &pattern, int flags=IgnoreCase) | |
PRegularExpression (const char *cpattern, int flags=IgnoreCase) | |
PRegularExpression (const PRegularExpression &) | |
PRegularExpression & | operator= (const PRegularExpression &) |
~PRegularExpression () | |
Release storage for the compiled regular expression. | |
Status functions | |
enum | ErrorCodes { NoError = 0, NoMatch, BadPattern, CollateError, BadClassType, BadEscape, BadSubReg, UnmatchedBracket, UnmatchedParen, UnmatchedBrace, BadBR, RangeError, OutOfMemory, BadRepitition, PrematureEnd, TooBig, UnmatchedRParen, NotCompiled } |
Error codes. More... | |
ErrorCodes | GetErrorCode () const |
PString | GetErrorText () const |
Public Member Functions | |
Compile & Execute functions | |
BOOL | Compile (const PString &pattern, int flags=IgnoreCase) |
BOOL | Compile (const char *cpattern, int flags=IgnoreCase) |
BOOL | Execute (const PString &str, PINDEX &start, int flags=0) const |
BOOL | Execute (const PString &str, PINDEX &start, PINDEX &len, int flags=0) const |
BOOL | Execute (const char *cstr, PINDEX &start, int flags=0) const |
BOOL | Execute (const char *cstr, PINDEX &start, PINDEX &len, int flags=0) const |
BOOL | Execute (const PString &str, PIntArray &starts, int flags=0) const |
BOOL | Execute (const PString &str, PIntArray &starts, PIntArray &ends, int flags=0) const |
BOOL | Execute (const char *cstr, PIntArray &starts, int flags=0) const |
BOOL | Execute (const char *cstr, PIntArray &starts, PIntArray &ends, int flags=0) const |
Static Public Member Functions | |
Miscellaneous functions | |
static PString | EscapeString (const PString &str) |
Protected Attributes | |
PString | patternSaved |
int | flagsSaved |
void * | expression |
int | lastError |
|
Flags for execution options.
|
|
Flags for compiler options.
|
|
|
Create a new, empty, regular expression.
|
|
Create and compile a new regular expression pattern.
|
|
Create and compile a new regular expression pattern.
|
|
Copy a regular expression |
|
Release storage for the compiled regular expression.
|
|
Compiler pattern. The pattern is compiled into an internal format to speed subsequent execution of the pattern match algorithm.
|
|
Compiler pattern.
|
|
Escape all characters in the #str# parameter that have a special meaning within a regular expression.
|
|
Execute regular expression. Execute the pattern match algorithm using the previously compiled pattern. The #starts# array is filled with as many matches as will fit into the array. If the the array size is zero then it is set to at least one for the first match found. The #ends# array is set to teh ending position of each substring whose start is returned in the #starts# array. This will always be set to the same size as that array.
|
|
Execute regular expression
|
|
Execute regular expression
|
|
Execute regular expression
|
|
Execute regular expression
|
|
Execute regular expression
|
|
Execute regular expression
|
|
Execute regular expression
|
|
Get the error code for the last Compile() or Execute() operation.
|
|
Get the text description for the error of the last Compile() or Execute() operation.
|
|
Assign a regular expression |
|
|
|
|
|
|
|
|