5 #include <boost/algorithm/string.hpp>
6 #include <boost/regex.hpp>
14 boost::regex rexp(regexp);
15 return boost::regex_match(pattern, rexp);
19 return (pattern.find_first_of(
"*?") != pattern.npos);
24 boost::replace_all(regexp,
"*",
".*");
25 boost::replace_all(regexp,
"?",
".");
29 std::vector<std::vector<std::string>::const_iterator>
30 regexMatch(std::vector<std::string>
const& strings, boost::regex
const& regexp) {
31 std::vector< std::vector<std::string>::const_iterator> matches;
32 for (std::vector<std::string>::const_iterator
i = strings.begin(), iEnd = strings.end();
i != iEnd; ++
i) {
33 if (boost::regex_match((*
i), regexp)) {
40 std::vector<std::vector<std::string>::const_iterator>
42 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)
bool untaintString(char const *pattern, char const *regexp)