15 std::string_view with)
19 std::string result(
str);
20 std::string::size_type pos = 0;
22 while ((pos = result.find(pattern, pos)) != std::string::npos) {
23 result.replace(pos, pattern.size(), with);
31 return std::regex_match(
str.begin(),
str.end(), expr);
37 result.reserve(glob.size() * 2);
49 case '^':
case '$':
case '+':
case '.':
case '\\':
50 case '(':
case ')':
case '[':
case ']':
case '{':
case '}':
case '|':
This module defines a variety of assert style macros.
bool match_expr(const std::regex &expr, std::string_view str)
returns: whether we can match the entire string with the regular expression guarantee: strong failure...
std::string substitute(std::string_view str, std::string_view pattern, std::string_view with)
effects: substitute all occurences of "pattern" with "with" in the string "str" returns: the substitu...
std::string glob_to_regexp(std::string_view glob)
returns: a string that is the regular expression equivalent of the given glob expression guarantee: s...