Regular
expression class.
|
Public Member Functions
|
|
|
RegularExpression () |
|
Default constructor.
|
|
RegularExpression (const RegularExpression
®ular_expression) |
|
Copy constructor.
|
|
RegularExpression (const String &pattern, bool
wildcard_pattern=false) |
virtual |
~RegularExpression () |
|
Destructor.
|
virtual void |
clear () |
|
Reset the object attributes to their
default values.
|
void |
destroy () |
|
Destroy the instance.
|
|
RegularExpression
& |
operator= (const RegularExpression
&expression) |
|
Assignment operator.
|
void |
set (const RegularExpression
®ular_expression) |
|
Assign from another
instance.
|
void |
set (const String &pattern, bool
wildcard_pattern=false) |
|
Assign from a string.
|
void |
get (RegularExpression
®ular_expression) const |
|
Assign to another
instance.
|
|
bool |
isEmpty () const |
|
Test if expression is
empty.
|
bool |
operator== (const RegularExpression
®ular_expression) const |
|
Equality operator.
|
bool |
operator!= (const RegularExpression
®ular_expression) const |
|
Inequality operator.
|
bool |
operator< (const RegularExpression
®ular_expression) const |
|
Less operator.
|
bool |
operator<= (const RegularExpression
®ular_expression) const |
|
Less or equal operator.
|
bool |
operator>= (const RegularExpression
®ular_expression) const |
|
Greater or equal
operator.
|
bool |
operator> (const RegularExpression
®ular_expression) const |
|
Greater operator.
|
|
virtual bool |
isValid () const |
|
Test if instance is
valid.
|
virtual void |
dump (std::ostream &s=std::cout, Size depth=0)
const |
|
Dump this instance to an ostream
depth is normaly just used for internal use.
|
Static Public Attributes
|
|
static const String |
ALPHA |
|
alphabetic letters.
|
static const String |
ALPHANUMERIC |
|
alphanumeric letters
|
static const String |
REAL |
|
real numbers
|
static const String |
IDENTIFIER |
|
identifier characters
|
static const String |
INTEGER |
|
integer characters
|
static const String |
HEXADECIMAL_INTEGER |
|
hexadecimal and integer
characters
|
static const String |
LOWERCASE |
|
lowercase letters
|
static const String |
NON_ALPHA |
|
non alphabetic characters
|
static const String |
NON_ALPHANUMERIC |
|
non alphanumeric
characters
|
static const String |
NON_NUMERIC |
|
non numeric characters
|
static const String |
NON_WHITESPACE |
|
non whitespace charcters
|
static const String |
UPPERCASE |
|
uppercase letters.
|
static const String |
WHITESPACE |
|
whitespace characters.
|
Friends
|
|
BALL_EXPORT friend std::ostream & |
operator<< (std::ostream &s, const RegularExpression
®ular_expression) |
|
output operator
|
BALL_EXPORT friend std::istream & |
operator>> (std::istream &s, RegularExpression
®ular_expression) |
|
input operator
|
Accessors
|
const String & |
getPattern () const |
|
Get the expression
pattern.
|
Size |
countSubexpressions () const |
|
Count subexpressions.
|
bool |
match (const String &text, Index
from=0, int execute_flags=0) const throw
(Exception::NullPointer, Exception::IndexUnderflow,
Exception::IndexOverflow) |
|
Match a text with this regular
expression.
|
bool |
match (const Substring &text,
Index from=0, int execute_flags=0) const throw
(Substring::InvalidSubstring, Exception::IndexUnderflow,
Exception::IndexOverflow) |
|
Match a substring with this regular
expression.
|
bool |
match (const char *text, int execute_flags=0) const
throw (Exception::NullPointer) |
|
Match a C-String with this regular
expression.
|
bool |
find (const String &text, Substring
&found, Index from=0, int execute_flags=0) const throw
(Exception::IndexUnderflow, Exception::IndexOverflow) |
|
Find this expression in a string.
|
bool |
find (const String &text, vector<
Substring >
&subexpressions, Index from=0, int execute_flags=0)
const throw (Exception::IndexUnderflow,
Exception::IndexOverflow) |
|
Find this expression in a string.
|
static bool |
match (const char *text, const char *pattern, int
compile_flags=0|REG_EXTENDED|REG_NOSUB, int
execute_flags=0) throw (Exception::NullPointer) |
|
Match a text with a given pattern.
|