#include <cel_regex.h>
Public Member Functions | |
RegularExpression (const UChar1 *inPattern, int inOptionFlags=regex_default) | |
RegularExpression (const String &inPattern, int inOptionFlags=regex_default) | |
RegularExpression (const utf8s &inPattern, int inOptionFlags=regex_default) | |
void | init (const UChar1 *inPattern, int inOptionFlags=regex_default) |
bool | findFirst (const String &str) |
bool | findFirst (const UChar1 *str, const UChar1 *rangePtr=NULL, const UChar1 *rangeEnd=NULL, const UChar1 *strEnd=NULL) |
bool | findNext () |
bool | isVaild () const |
size_t | getCount () const |
size_t | getPos (size_t n=0) const |
size_t | getEndPos (size_t n=0) const |
size_t | getLength (size_t n=0) const |
const UChar1 * | getPtr (size_t n=0) const |
String | getString (size_t n=0) const |
This class provides the function of search using the Regular Expression. The regular expression is a common method of searching, matching and separation of strings.
For details for regular expression syntax, see Regular Expression.
The following is the sample code of using RegularExpression class.
|
inline |
This method create a RegularExpression instance.
inPattern | A pattern to search. |
inOptionFlags | Any combination of RegexOptionFlag enumerations to control the behavior. |
|
inline |
This method create a RegularExpression instance.
inPattern | A pattern to search. |
inOptionFlags | Any combination of RegexOptionFlag enumerations to control the behavior. |
|
inline |
This method create a RegularExpression instance.
inPattern | A pattern to search. |
inOptionFlags | Any combination of RegexOptionFlag enumerations to control the behavior. |
|
inline |
This method begins a new search in the specified string.
str | The string on which the new search starts. |
true
if at least one matching portion is found, otherwise false
.
|
inline |
This method begins a new search in the specified string.
str | A string to do pattern matching on. |
rangePtr | Pointer to the beginning point of pattern matching. |
rangeEnd | Pointer to the ending point of pattern matching. |
strEnd | Pointer to the string end. If this parameter is explicitly specified, then str don't have to be terminated by '\0'. |
true
if at least one matching portion is found, otherwise false
.
|
inline |
This method returns the next matching portion if available.
true
if at least one more matching portion is found, otherwise false
.
|
inline |
This method returns the count of the portions stored in this instance.
|
inline |
This method returns the ending position of the specified portion.
n | The index of the portion. |
|
inline |
This method returns the length of the specified portion.
n | The index of the portion. |
|
inline |
This method returns the beginning position of the specified portion.
n | The index of the portion. |
|
inline |
This method returns the pointer to the specified portion.
n | The index of the portion. |
|
inline |
This method returns the string of the specified portion.
n | The index of the portion. |
|
inline |
This method re-initializes the instance to search another pattern.
inPattern | A pattern to search. |
inOptionFlags | Any combination of RegexOptionFlag enumerations to control the behavior. |
Referenced by RegularExpression().
|
inline |
This method verifies whether the last match is valid or not.
true
if valid, otherwise false
.