ui-utilcpp 1.10.3
|
Wrapper class for POSIX.2 regex functions. More...
#include <PosixRegex.hpp>
Data Structures | |
class | Match |
Helper class representing match data. More... | |
Public Types | |
typedef CodeException< reg_errcode_t > | Exception |
Exceptions we might throw. | |
Public Member Functions | |
PosixRegex (std::string const ®ex, int cflags=0) | |
Match | runMatch (std::string const &text, int eflags=0) |
Check if text matches, and return the (first) match. | |
bool | run (std::string const &text, int eflags=0) |
Check if text matches. | |
Wrapper class for POSIX.2 regex functions.
Not fully encapsulated; flags must be given using the values from regex.h; Catched exception code must be compared against the reg_errcode_t defined in regex.h.
Does not support multiple matches (seems this does not work anyway currently)
Does not support clear text error reporting as via regerror.
regex | The regular expression |
cflags | Flags as described in regex(3) |
References UI_THROW_CODE.
Check if text matches.
text | Text to examine. |
eflags | Flags as described in regex(3). |
References UI::Util::PosixRegex::Match::matches, and runMatch().
PosixRegex::Match UI::Util::PosixRegex::runMatch | ( | std::string const & | text, |
int | eflags = 0 |
||
) |
Check if text matches, and return the (first) match.
text | Text to examine. |
eflags | Flags as described in regex(3). |
References UI_THROW_CODE.
Referenced by run().