3 #include <boost/regex.hpp>
4 #include <boost/algorithm/string.hpp>
11 return (pattern.find_first_of(
"*?") != pattern.npos);
16 boost::replace_all(regexp,
"*",
".*");
17 boost::replace_all(regexp,
"?",
".");
21 std::vector<std::vector<std::string>::const_iterator>
22 regexMatch(std::vector<std::string>
const& strings, boost::regex
const& regexp) {
23 std::vector< std::vector<std::string>::const_iterator> matches;
24 for (std::vector<std::string>::const_iterator
i = strings.begin(), iEnd = strings.end();
i != iEnd; ++
i) {
25 if (boost::regex_match((*
i), regexp)) {
32 std::vector<std::vector<std::string>::const_iterator>
34 boost::regex regexp(
glob2reg(pattern));
bool is_glob(std::string const &pattern)
std::string glob2reg(std::string const &pattern)
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, boost::regex const ®exp)