#include #include #include using namespace boost; using namespace std; regex expression1("dpkg-(old|dist|new|tmp)$", regex::extended); regex expression2(".*dpkg-(old|dist|new|tmp)$", regex::extended); int main () { std::string value("foobar.dpkg-old"); if (regex_match(value, expression1)) cout << "It matched the first" << endl; else cout << "It didn't match the first" << endl; if (regex_match(value, expression2)) cout << "It matched the second" << endl; else cout << "It didn't match the second" << endl; return 0; }