Go to the documentation of this file.
45 return string::meta<regExp>(str);
72 word(std::move(static_cast<
word&>(str))),
73 re_(std::move(str.re_))
165 return !re_.exists();
187 comp = string::meta<regExp>(*
this) || !string::valid<word>(*
this);
208 return re_.set(*
this);
217 string::stripInvalid<word>(*
this);
231 if (!literal && re_.exists())
233 return re_.match(text);
236 return !compare(text);
242 return string::quotemeta<regExp>(*
this);
static bool valid(char c)
Is this character valid for a keyType?
A class for handling words, derived from Foam::string.
static bool valid(char c)
Is this character valid for a wordRe?
void operator=(const wordRe &str)
Copy assignment, retaining type (literal or regex)
bool isPattern() const
The keyType is treated as a pattern, not as literal string.
Detect if the string contains meta-characters.
A class for handling character strings derived from std::string.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
bool compile()
Compile the regular expression.
A class for handling keywords in dictionaries.
static bool isPattern(const std::string &str)
Test string for regular expression meta characters.
void set(const std::string &str, const compOption opt=DETECT)
Copy string, auto-test for regular expression or other options.
string quotemeta() const
Return a string with quoted meta-characters.
Ignore case in regular expression.
static int debug
Debugging.
void clear()
Clear string and regular expression.
bool match(const UList< wordRe > &patterns, const std::string &text)
Return true if text matches one of the regular expressions.
bool isLiteral() const
The wordRe is treated as literal string, not as pattern.
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.
void swap(std::string &str)
Swap contents. Self-swapping is a no-op.
void assign(Field< Tout > &result, const Field< T1 > &a, const UnaryOp &op)
Populate a field as the result of a unary operation on an input.
static bool meta(char c)
Is this a meta character?
void uncompile(bool adjust=false)
Make wordRe a literal again, instead of a regular expression.
bool operator()(const std::string &text) const
Perform smart match on text, as per match()
bool match(const std::string &text, bool literal=false) const
Smart match as regular expression or as a string.
compOption
Enumeration with compile options.
bool isPattern() const
The wordRe is treated as a pattern, not as literal string.
void swap(wordRe &str)
Swap contents. Self-swapping is a no-op.