-
- /**
- * Converts '*' and '?' wildcards within str into their regex equivalents.
- */
- static string wildcards2regex(const string & str)
- {
- string regexed = str;
-
- string r_all(".*"); // regex equivalent of '*'
- string r_one("."); // regex equivalent of '?'
- string::size_type pos;
-
- // replace all "*" in input with ".*"
- for (pos = 0; (pos = regexed.find("*", pos)) != std::string::npos; pos+=2)
- regexed = regexed.replace(pos, 1, r_all);
-
- // replace all "?" in input with "."
- for (pos = 0; (pos = regexed.find('?', pos)) != std::string::npos; ++pos)
- regexed = regexed.replace(pos, 1, r_one);
-
- return regexed;
- }
-
- string PoolQuery::Impl::createRegex( const StrContainer & container, const Match & flags ) const