13 return pattern.find_first_of(
"*?") != std::string::npos;
28 auto const reg_str =
glob2reg(pattern);
30 std::regex
const regexp{
"(\\d+:)?" +
glob2reg(pattern)};
32 for (
auto it = strings.begin(),
e = strings.end(); it !=
e; ++it) {
33 if (std::regex_match(*it, regexp)) {
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::string const &pattern)
bool replace_all(std::string &in, std::string const &from, std::string const &to)
Replace all occurrences of from in string with to.
std::string glob2reg(std::string pattern)
bool is_glob(std::string const &pattern)