#include <BALL/DATATYPE/regularExpression.h>
|
const String & | getPattern () const |
| Get the expression pattern. More...
|
|
Size | countSubexpressions () const |
| Count subexpressions. More...
|
|
bool | match (const String &text, Index from=0, int execute_flags=0) const |
|
bool | match (const Substring &text, Index from=0, int execute_flags=0) const |
|
bool | match (const char *text, int execute_flags=0) const |
|
bool | find (const String &text, Substring &found, Index from=0, int execute_flags=0) const |
|
bool | find (const String &text, vector< Substring > &subexpressions, Index from=0, int execute_flags=0) const |
|
static bool | match (const char *text, const char *pattern, int compile_flags=0|REG_EXTENDED|REG_NOSUB, int execute_flags=0) |
|
Regular expression class
Definition at line 54 of file regularExpression.h.
BALL::RegularExpression::RegularExpression |
( |
| ) |
|
BALL::RegularExpression::RegularExpression |
( |
const RegularExpression & |
regular_expression | ) |
|
BALL::RegularExpression::RegularExpression |
( |
const String & |
pattern, |
|
|
bool |
wildcard_pattern = false |
|
) |
| |
virtual BALL::RegularExpression::~RegularExpression |
( |
| ) |
|
|
virtual |
virtual void BALL::RegularExpression::clear |
( |
| ) |
|
|
virtual |
Reset the object attributes to their default values.
Size BALL::RegularExpression::countSubexpressions |
( |
| ) |
const |
void BALL::RegularExpression::destroy |
( |
| ) |
|
virtual void BALL::RegularExpression::dump |
( |
std::ostream & |
s = std::cout , |
|
|
Size |
depth = 0 |
|
) |
| const |
|
virtual |
Dump this instance to an ostream depth is normaly just used for internal use.
- Parameters
-
s | the ostream, default is the standard output |
depth | the indentation depth of the output |
bool BALL::RegularExpression::find |
( |
const String & |
text, |
|
|
Substring & |
found, |
|
|
Index |
from = 0 , |
|
|
int |
execute_flags = 0 |
|
) |
| const |
Find this expression in a string
- Parameters
-
from | index in the string to start the matching |
found | the result is stored as a substring here |
execute_flags | ????? |
- Exceptions
-
bool BALL::RegularExpression::find |
( |
const String & |
text, |
|
|
vector< Substring > & |
subexpressions, |
|
|
Index |
from = 0 , |
|
|
int |
execute_flags = 0 |
|
) |
| const |
Find this expression in a string
- Parameters
-
text | to process |
subexpressions | the results are stored here |
from | index in the string to start the matching |
execute_flags | ????? |
- Exceptions
-
Assign to another instance.
const String& BALL::RegularExpression::getPattern |
( |
| ) |
const |
Get the expression pattern.
bool BALL::RegularExpression::isEmpty |
( |
| ) |
const |
Test if expression is empty.
virtual bool BALL::RegularExpression::isValid |
( |
| ) |
const |
|
virtual |
Test if instance is valid.
static bool BALL::RegularExpression::match |
( |
const char * |
text, |
|
|
const char * |
pattern, |
|
|
int |
compile_flags = 0|REG_EXTENDED|REG_NOSUB , |
|
|
int |
execute_flags = 0 |
|
) |
| |
|
static |
Match a text with a given pattern.
- Parameters
-
text | to process |
pattern | to compare with |
compile_flags | ????? |
execute_flags | ????? |
- Exceptions
-
NullPointer | if text or pattern are NULL |
bool BALL::RegularExpression::match |
( |
const String & |
text, |
|
|
Index |
from = 0 , |
|
|
int |
execute_flags = 0 |
|
) |
| const |
Match a text with this regular expression.
- Parameters
-
text | to process |
from | index in the string to start the matching |
execute_flags | ????? |
- Exceptions
-
bool BALL::RegularExpression::match |
( |
const Substring & |
text, |
|
|
Index |
from = 0 , |
|
|
int |
execute_flags = 0 |
|
) |
| const |
Match a substring with this regular expression.
- Parameters
-
text | to process |
from | index in the substring to start the matching |
execute_flags | ????? |
- Exceptions
-
bool BALL::RegularExpression::match |
( |
const char * |
text, |
|
|
int |
execute_flags = 0 |
|
) |
| const |
Match a C-String with this regular expression.
- Parameters
-
text | to process |
execute_flags | ????? |
- Exceptions
-
NullPointer | if text is NULL |
Greater or equal operator
Assign from another instance.
void BALL::RegularExpression::set |
( |
const String & |
pattern, |
|
|
bool |
wildcard_pattern = false |
|
) |
| |
const String BALL::RegularExpression::ALPHA |
|
static |
const String BALL::RegularExpression::ALPHANUMERIC |
|
static |
const String BALL::RegularExpression::HEXADECIMAL_INTEGER |
|
static |
const String BALL::RegularExpression::IDENTIFIER |
|
static |
const String BALL::RegularExpression::INTEGER |
|
static |
const String BALL::RegularExpression::LOWERCASE |
|
static |
const String BALL::RegularExpression::NON_ALPHA |
|
static |
const String BALL::RegularExpression::NON_ALPHANUMERIC |
|
static |
const String BALL::RegularExpression::NON_NUMERIC |
|
static |
const String BALL::RegularExpression::NON_WHITESPACE |
|
static |
const String BALL::RegularExpression::REAL |
|
static |
const String BALL::RegularExpression::UPPERCASE |
|
static |
const String BALL::RegularExpression::WHITESPACE |
|
static |