Go to the documentation of this file.
37 || (
c ==
'*' ||
c ==
'+' ||
c ==
'?')
38 || (
c ==
'(' ||
c ==
')' ||
c ==
'|')
39 || (
c ==
'[' ||
c ==
']')
72 set(pattern, ignoreCase);
80 set(pattern, ignoreCase);
116 return preg_ ? preg_->re_nsub : 0;
122 return std::string::npos !=
find(text);
131 std::swap(preg_, rgx.preg_);
Wrapper around POSIX extended regular expressions.
void swap(regExpPosix &rgx)
Swap contents.
bool search(const std::string &text) const
Return true if the regex was found within the text.
void operator=(const regExpPosix &)=delete
Copy assignment - disallowed.
~regExpPosix()
Destructor.
bool operator()(const std::string &text) const
Perform match on text.
static bool meta(char c)
Test if character appears to be a regular expression meta-character.
bool empty() const noexcept
Return true if a precompiled expression does not exist.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
bool set(const char *pattern, bool ignoreCase=false)
Compile pattern into a regular expression, optionally ignore case.
regExpPosix()
Construct null.
bool match(const UList< wordRe > &patterns, const std::string &text)
Return true if text matches one of the regular expressions.
unsigned ngroups() const
The number of capture groups for a non-empty expression.
bool exists() const noexcept
Return true if a precompiled expression exists.
const dimensionedScalar c
Speed of light in a vacuum.