4 #include "cetlib/replace_all.h" 15 return (pattern.find_first_of(
"*?") != std::string::npos);
21 cet::replace_all(pattern,
"*",
".*");
22 cet::replace_all(pattern,
"?",
".");
27 regexMatch(std::vector<std::string>
const& strings, std::regex
const& regexp)
30 for (
auto i = strings.begin(), iEnd = strings.end(); i != iEnd; ++i) {
31 if (std::regex_match((*i), regexp)) {
40 std::string
const& pattern)
42 std::regex
const regexp{
glob2reg(pattern)};
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::regex const ®exp)
std::string glob2reg(std::string pattern)
bool is_glob(std::string const &pattern)