|
Boost Users : |
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2007-03-06 17:16:08
fs::path upper("c:/differences", fs::native);
fs::path checked(upper/"checked");
assert(fs::exists(upper));
assert(fs::exists(checked));
fs::directory_iterator end;
rg::regex rgx("*ps", rg::regex::basic);
for (fs::directory_iterator it(upper); it != end; ++it)
{
if (rg::regex_match(it->string(), rgx))
std::cout << "MATCH: ";
else
std::cout << "NOMATCH: ";
std::cout << it->string() << std::endl;
}
Supposed to be looking for ps files. tried *\\.ps, which should work
but also didn't. Doesn't match any of the strings.
One example line of output:
NOMATCH: c:/differences/Adj. speed test case 5 (metric units).ps
Supposedly regex is greedy, no? It should accept . as a * element and
continue to match everything up to ps and ps also...why no worky?
Thanks.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net