36 return string::meta<regExp>(str);
129 bool doCompile =
false;
131 if (opt & compOption::regExp)
135 else if (opt & compOption::detect)
137 if (string::meta<regExp>(*
this) || !string::valid<word>(*
this))
142 else if (opt & compOption::noCase)
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);
274 compile(compOption::detect);
281 compile(compOption::detect);
288 compile(compOption::detect);
292 inline int Foam::operator&
298 return int(co1) & int(co2);
A class for handling keywords in dictionaries.
bool isPattern() const
Should be treated as a match rather than a literal string.
static bool meta(char c)
Is character a regular expression meta-character?
A class for handling character strings derived from std::string.
void operator=(const string &)
A wordRe is a word, but can also have a regular expression for matching words.
bool isPattern() const
Should be treated as a match rather than a literal string?
void uncompile(const bool doStripInvalid=false) const
Frees precompiled regular expression, making wordRe a literal.
string quotemeta() const
Return a string with quoted meta-characters.
void operator=(const wordRe &)
Assign copy.
bool compile() const
Compile the regular expression.
void set(const std::string &, const compOption=compOption::detect)
Copy string, auto-test for regular expression or other options.
static bool isPattern(const string &)
Test string for regular expression meta characters.
bool match(const std::string &, bool literalMatch=false) const
Smart match as regular expression or as a string.
compOption
Enumeration with compile options.
bool recompile() const
Recompile an existing regular expression.
static bool meta(char)
Is this a meta character?
void clear()
Clear string and precompiled regular expression.
A class for handling words, derived from string.
void operator=(const word &)
const dimensionedScalar c
Speed of light in a vacuum.