38 #ifndef Foam_wordRes_H 39 #define Foam_wordRes_H 66 inline static label first_match
69 const std::string& text,
70 const bool literal =
false 82 return NullObjectRef<wordRes>();
103 inline static bool match 106 const std::string& text,
118 const std::string& text
124 template<
class StringType>
138 template<
class StringType>
160 inline bool match(
const std::string& text,
bool literal=
false)
const;
173 template<
class StringType>
186 inline bool operator()(
const std::string& text)
const;
203 inline
bool operator()(const
std::
string& text) const;
237 inline
bool operator()(const
std::
string& text) const;
252 #include "wordResI.H" static wordRe::compOption matched(const UList< wordRe > &selectors, const std::string &text)
Smart match across entire list, returning the best match type.
UList< wordRe > wordReUList
UList of wordRe (word or regex)
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
compOption
Enumeration with compile options.
static const wordRes & null() noexcept
Return a null wordRes (reference to a nullObject). Behaves like a empty wordRes.
Functor wrapper of allow/deny lists of wordRe for filtering.
static labelList matching(const wordRe &select, const UList< StringType > &input, const bool invert=false)
Determine the list indices for all matches.
static Istream & input(Istream &is, IntRange< T > &range)
A List of wordRe with additional matching capabilities.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
matcher(const UList< wordRe > &selectors) noexcept
Construct with select matcher(s)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
static bool match(const UList< wordRe > &selectors, const std::string &text, bool literal=false)
Test for a match.
List< wordRe > wordReList
List of wordRe (word or regex)
~wordRes()=default
Destructor.
void uniq()
Filter out duplicate entries (inplace).
bool operator()(const std::string &text) const
Identical to match(), for use as a predicate.
bool empty() const noexcept
No selectors defined.