Go to the documentation of this file.
32 return NullObjectRef<wordRes>();
36 inline Foam::label Foam::wordRes::first_match
39 const std::string& text,
44 for (
const wordRe& select : selectors)
46 if (select.match(text, literal))
59 const UList<wordRe>& selectors,
60 const std::string& text
63 auto retval(wordRe::compOption::UNKNOWN);
65 for (
const wordRe& select : selectors)
67 if (select.isLiteral())
69 if (select.match(text,
true))
71 return wordRe::compOption::LITERAL;
77 retval == wordRe::compOption::UNKNOWN
78 && select.match(text,
false)
81 retval = wordRe::compOption::REGEX;
93 return (first_match(*
this, text, literal) >= 0);
100 return found_matched(*
this, text);
104 template<
class StringType>
111 const label len =
input.size();
116 for (label i=0; i < len; ++i)
124 indices.resize(
count);
134 return (wordRes::first_match(*
this, text) >= 0);
140 return (wordRes::first_match(
values, text) >= 0);
labelList matching(const UList< StringType > &input, const bool invert=false) const
void resize(const label len)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
wordRe::compOption matched(const std::string &text) const
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
labelList invert(const label len, const labelUList &map)
bool match(const std::string &text, bool literal=false) const
bool operator()(const std::string &text) const
bool match(const UList< wordRe > &patterns, const std::string &text)
unsigned int count(const UList< bool > &bools, const bool val=true)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A List of wordRe with additional matching capabilities.
bool operator()(const std::string &text) const
static Istream & input(Istream &is, IntRange< T > &range)
static const wordRes & null()