Wrapper around C++11 regular expressions with some additional prefix-handling. The prefix-handling is loosely oriented on PCRE regular expressions and provides a simple means of tuning the expressions. More...
Classes | |
struct | meta |
Public Types | |
typedef std::smatch | results_type |
Public Member Functions | |
regExpCxx () | |
regExpCxx (const regExpCxx &rgx) | |
regExpCxx (regExpCxx &&rgx) noexcept | |
regExpCxx (const char *pattern, const bool ignoreCase=false) | |
regExpCxx (const std::string &pattern, const bool ignoreCase=false) | |
~regExpCxx ()=default | |
bool | empty () const noexcept |
bool | exists () const noexcept |
bool | negated () const noexcept |
bool | negate (bool on) noexcept |
unsigned | ngroups () const |
bool | nocase () const |
bool | clear () |
void | swap (regExpCxx &rgx) |
bool | set (const char *pattern, bool ignoreCase=false) |
bool | set (const std::string &pattern, bool ignoreCase=false) |
std::string::size_type | find (const std::string &text) const |
bool | match (const std::string &text) const |
bool | match (const std::string &text, results_type &matches) const |
bool | search (const std::string &text) const |
bool | operator() (const std::string &text) const |
void | operator= (const regExpCxx &rgx) |
void | operator= (regExpCxx &&rgx) |
void | operator= (const char *pattern) |
void | operator= (const std::string &pattern) |
Static Public Member Functions | |
static bool | is_meta (const char c) noexcept |
static bool | is_meta (const std::string &str, const char quote='\\') |
Static Public Attributes | |
static int | grammar |
Wrapper around C++11 regular expressions with some additional prefix-handling. The prefix-handling is loosely oriented on PCRE regular expressions and provides a simple means of tuning the expressions.
The prefixes are detected as (?...) at the beginning of the regular expression. Any unknown/unsupported prefixes are silently ignored.
'i'
indicates ignore-case'!'
(exclamation) indicates negated (inverted) matchingSince ECMAScript grammar may not work correctly on all installations, the current default is to use extended regular expressions.
The C++11 regular expressions may be broken on some compilers. For example, gcc 4.8 is known to fail. For these systems the POSIX implementation or alternative must be used.
Definition at line 78 of file regExpCxx.H.
typedef std::smatch results_type |
Definition at line 110 of file regExpCxx.H.
|
inline |
Definition at line 75 of file regExpCxxI.H.
Definition at line 82 of file regExpCxxI.H.
Definition at line 89 of file regExpCxxI.H.
Definition at line 99 of file regExpCxxI.H.
References Foam::BitOps::set().
Definition at line 112 of file regExpCxxI.H.
References Foam::BitOps::set().
|
default |
|
inlinestaticnoexcept |
Definition at line 35 of file regExpCxxI.H.
References Foam::constant::universal::c.
Referenced by regExpPosix::is_meta(), and regExpCxx::meta::operator()().
|
inlinestatic |
Definition at line 48 of file regExpCxxI.H.
References Foam::constant::universal::c.
|
inlinenoexcept |
Definition at line 126 of file regExpCxxI.H.
|
inlinenoexcept |
Definition at line 132 of file regExpCxxI.H.
|
inlinenoexcept |
Definition at line 138 of file regExpCxxI.H.
Definition at line 144 of file regExpCxxI.H.
|
inline |
Definition at line 164 of file regExpCxxI.H.
|
inline |
Definition at line 171 of file regExpCxxI.H.
|
inline |
Definition at line 177 of file regExpCxxI.H.
|
inline |
Definition at line 191 of file regExpCxxI.H.
Definition at line 202 of file regExpCxxI.H.
Definition at line 214 of file regExpCxxI.H.
|
inline |
Definition at line 226 of file regExpCxxI.H.
|
inline |
Definition at line 282 of file regExpCxxI.H.
|
inline |
Definition at line 297 of file regExpCxxI.H.
References Foam::stringOps::match().
|
inline |
Definition at line 268 of file regExpCxxI.H.
|
inline |
Definition at line 315 of file regExpCxxI.H.
References Foam::stringOps::match().
|
inline |
Definition at line 321 of file regExpCxxI.H.
|
inline |
Definition at line 332 of file regExpCxxI.H.
References clear().
|
inline |
Definition at line 343 of file regExpCxxI.H.
References Foam::BitOps::set().
|
inline |
Definition at line 349 of file regExpCxxI.H.
References Foam::BitOps::set().
|
static |
Definition at line 116 of file regExpCxx.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.