66 inline static label first_match
69 const std::string& text,
70 const bool literal =
false
106 inline static bool match
109 const std::string& text,
121 const std::string& text
127 template<
class StringType>
141 template<
class StringType>
163 inline bool match(
const std::string& text,
bool literal=
false)
const;
176 template<
class StringType>
189 inline bool operator()(
const std::string& text)
const;
207 inline
bool operator()(const std::
string& text) const;
239 inline bool empty()
const noexcept;
242 explicit operator bool()
const noexcept {
return !
empty(); }
248 inline bool operator()(
const std::string& text)
const;
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 wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
compOption
Enumeration with compile options.
A List of wordRe with additional matching capabilities.
void uniq()
Filter out duplicate entries (inplace).
static const wordRes & null() noexcept
Return a null wordRes (reference to a nullObject). Behaves like a empty wordRes.
static labelList matching(const wordRe &select, const UList< StringType > &input, const bool invert=false)
Determine the list indices for all matches.
bool operator()(const std::string &text) const
Identical to match(), for use as a predicate.
static labelList matching(const UList< wordRe > &selectors, const UList< StringType > &input, const bool invert=false)
Determine the list indices for all matches.
~wordRes()=default
Destructor.
static wordRe::compOption matched(const UList< wordRe > &selectors, const std::string &text)
Smart match across entire list, returning the best match type.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Determine the list indices for all matches.
static bool match(const UList< wordRe > &selectors, const std::string &text, bool literal=false)
Test for a match of any selectors against the text.
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
List< label > labelList
A List of labels.
List< wordRe > wordReList
List of wordRe (word or regex).
UList< wordRe > wordReUList
UList of wordRe (word or regex).
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
Functor wrapper of allow/deny lists of wordRe for filtering.
filter(const UList< wordRe > &allow, const UList< wordRe > &deny) noexcept
Construct with allow and deny matchers.
bool empty() const noexcept
No filtering defined.
bool operator()(const std::string &text) const
Apply filter against specified text.
Functor wrapper of a list of wordRe for matching.
bool empty() const noexcept
No selectors defined.
bool operator()(const std::string &text) const
Apply matcher predicate.
matcher(const UList< wordRe > &selectors) noexcept
Construct with select matcher(s).