29 #include <hboost/xpressive/basic_regex.hpp>
35 template <
typename T>
class UT_Array;
51 explicit UT_Regex(
const char *expr,
bool case_sensitive =
true)
53 init(expr, case_sensitive);
61 initFromGlob(pattern);
69 initFromGlob(pattern,
true,
true);
74 bool init(
const char *expr,
bool case_sensitive =
true);
79 bool initFromGlob(
const char *
pattern,
80 bool case_sensitive=
true,
81 bool is_bundle_glob=
false);
97 static bool convertGlobToExpr(
100 bool is_bundle_glob =
false);
104 bool isValid()
const;
110 bool match(
const char *
string)
const;
113 {
return match(str.
c_str()); }
124 bool match(
const char *
string,
141 bool search(
const char *
string,
147 bool search(
const char *
string,
154 bool search(
const char *
string,
155 UT_Array<std::pair<exint, exint>> &indicies,
163 bool search(
const char *
string,
186 exint maxsplits = 0)
const;
190 exint maxsplits = 0)
const;
201 bool replace_all =
false,
202 bool copy_on_fail =
true
210 exint num_replacements,
211 bool copy_on_fail =
true
215 hboost::xpressive::cregex myExpr;
bool match(const UT_StringRef &str) const
std::string getErrorString(int errorNum)
Return a string (possibly empty) describing the given system error code.
static FromBundleGlobTag FromBundleGlob
static FromGlobTag FromGlob
**But if you need a result
const char * c_str() const
A utility class to do read-only operations on a subset of an existing string.
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
UT_Regex(const char *pattern, FromBundleGlobTag)
auto search(const T &set, const V &val) -> std::pair< bool, decltype(std::begin(detail::smart_deref(set)))>
A search function.
UT_Regex(const char *expr, bool case_sensitive=true)
void OIIO_UTIL_API split(string_view str, std::vector< string_view > &result, string_view sep=string_view(), int maxsplit=-1)
UT_Regex(const char *pattern, FromGlobTag)
bool match(const UT_String &str) const