#include #include #include // needs to link with this lib // -lboost_regex int main(int argc, char** argv) { std::string fn; boost::regex expression(".*txt"); std::cout << "Enter a file name: "; std::cin >> fn; if (boost::regex_match(fn, expression)) { std::cout << "its a text file" << std::endl; } return 0; }