2 #include "cetlib/replace_all.h" 13 return pattern.find_first_of(
"*?") != std::string::npos;
19 cet::replace_all(pattern,
"*",
".*");
20 cet::replace_all(pattern,
"?",
".");
26 std::string
const& pattern)
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)
std::string glob2reg(std::string pattern)
bool is_glob(std::string const &pattern)