36 return string::meta<regExp>(str);
129 bool doCompile =
false;
137 if (string::meta<regExp>(*
this) || !string::valid<word>(*
this))
150 re_.
set(*
this, (opt & compOption::noCase));
186 string::stripInvalid<word>
188 const_cast<word&
>(
static_cast<const word&
>(*this))
204 if (literalMatch || !re_.
exists())
207 return (str == *
this);
212 return re_.
match(str);
219 return string::quotemeta<regExp>(*this);
292 inline int Foam::operator&
298 return int(co1) & int(co2);
A class for handling keywords in dictionaries.
bool clear() const
Release precompiled expression.
bool match(const std::string &) const
Return true if it matches the entire string.
bool recompile() const
Recompile an existing regular expression.
void operator=(const wordRe &)
Assign copy.
static bool meta(char c)
Is character a regular expression meta-character?
treat as regular expression
compOption
Enumeration with compile options.
void operator=(const word &)
bool isPattern() const
Should be treated as a match rather than a literal string?
static bool meta(char)
Is this a meta character?
bool compile() const
Compile the regular expression.
bool exists() const
Does a precompiled expression exist?
void set(const std::string &, const compOption=compOption::detect)
Copy string, auto-test for regular expression or other options.
A class for handling words, derived from string.
static bool isPattern(const string &)
Test string for regular expression meta characters.
detect if the string contains meta-characters
A wordRe is a word, but can also have a regular expression for matching words.
void clear()
Clear string and precompiled regular expression.
string quotemeta() const
Return a string with quoted meta-characters.
ignore case in regular expression
const dimensionedScalar c
Speed of light in a vacuum.
void operator=(const string &)
void uncompile(const bool doStripInvalid=false) const
Frees precompiled regular expression, making wordRe a literal.
void set(const char *, const bool ignoreCase=false) const
Compile pattern into a regular expression,.
A class for handling character strings derived from std::string.
bool match(const std::string &, bool literalMatch=false) const
Smart match as regular expression or as a string.
bool isPattern() const
Should be treated as a match rather than a literal string.