Go to the documentation of this file.
30 inline std::regex::flag_type Foam::regExpCxx::syntax()
36 ? std::regex::ECMAScript
37 : std::regex::extended
47 || (
c ==
'*' ||
c ==
'+' ||
c ==
'?')
48 || (
c ==
'(' ||
c ==
')' ||
c ==
'|')
49 || (
c ==
'[' ||
c ==
']')
72 re_(std::move(rgx.re_)),
102 set(pattern, ignoreCase);
111 set(pattern, ignoreCase);
131 return ok_ ? re_.mark_count() : 0;
137 return ok_ && ((re_.flags() & std::regex::icase) == std::regex::icase);
161 std::swap(ok_, rgx.ok_);
170 if (!text.empty() && std::regex_search(text, mat, re_))
172 return mat.position(0);
175 return std::string::npos;
181 return (ok_ && !text.empty() && std::regex_search(text, re_));
187 return (ok_ && !text.empty() && std::regex_match(text, re_));
193 const std::string& text,
197 return std::regex_match(text, matches, re_);
unsigned ngroups() const
The number of capture groups for a non-empty expression.
std::string::size_type find(const std::string &text) const
Find position within the text.
bool operator()(const std::string &text) const
Perform match on text.
bool set(const char *pattern, bool ignoreCase=false)
Compile pattern into a regular expression, optionally ignore case.
bool match(const std::string &text) const
True if the regex matches the entire text.
regExpCxx()
Construct null.
bool empty() const noexcept
Return true if expression is empty.
graph_traits< Graph >::vertices_size_type size_type
Wrapper around C++11 regular expressions.
bool search(const std::string &text) const
Return true if the regex was found within the text.
bool clear()
Clear expression.
bool match(const UList< wordRe > &patterns, const std::string &text)
Return true if text matches one of the regular expressions.
void operator=(const regExpCxx &rgx)
Copy assignment.
void swap(regExpCxx &rgx)
Swap contents.
static bool meta(const char c)
Test if character appears to be a regular expression meta-character.
const dimensionedScalar c
Speed of light in a vacuum.
bool exists() const noexcept
Return true if expression is non-empty.
static int grammar
The default grammar (extended | ECMAScript).