FX::FXRex Class Reference

#include <FXRex.h>

List of all members.


Detailed Description

FXRex is a regular expression class implementing a NFA matcher. It supports capturing parentheses, non-capturing parentheses, positive or negative lookahead, backreferences, case-insensitive matching, counted repetitions, lazy or greedy matches, and PERL-like matching operators. The subject string may be scanned forwards or backwards, and may contain any of 256 possible character values.

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.

Definition at line 100 of file FXRex.h.

Public Member Functions

 FXRex ()
 FXRex (const FXRex &orig)
 FXRex (const FXchar *pattern, FXint mode=REX_NORMAL, FXRexError *error=NULL)
 FXRex (const FXString &pattern, FXint mode=REX_NORMAL, FXRexError *error=NULL)
FXRexoperator= (const FXRex &orig)
bool empty () const
FXRexError parse (const FXchar *pattern, FXint mode=REX_NORMAL)
FXRexError parse (const FXString &pattern, FXint mode=REX_NORMAL)
bool 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
bool match (const FXString &string, FXint *beg=NULL, FXint *end=NULL, FXint mode=REX_FORWARD, FXint npar=1, FXint fm=0, FXint to=2147483647) const
bool operator== (const FXRex &rex) const
bool operator!= (const FXRex &rex) const
 ~FXRex ()

Static Public Member Functions

static FXString substitute (const FXchar *string, FXint len, FXint *beg, FXint *end, const FXString &replace, FXint npar=1)
static FXString substitute (const FXString &string, FXint *beg, FXint *end, const FXString &replace, FXint npar=1)
static const FXchargetError (FXRexError err)

Friends

FXAPI FXStreamoperator<< (FXStream &store, const FXRex &s)
FXAPI FXStreamoperator>> (FXStream &store, FXRex &s)


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:35:56 2009 for TnFOX by doxygen v1.4.7