#include #include int main() { std::regex pattern { "[[:alpha:]]" }; std::cout << "'[[:alpha:]]' match with 'a': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'[[:alpha:]]' match with '1': " << std::boolalpha << std::regex_match("1", pattern) << std::endl; std::cout << "'[[:alpha:]]' match with '&': " << std::boolalpha << std::regex_match("&", pattern) << std::endl; pattern = "[[:alnum:]]"; std::cout << "'[[:alnum:]]' match with 'a': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'[[:alnum:]]' match with '1': " << std::boolalpha << std::regex_match("1", pattern) << std::endl; std::cout << "'[[:alnum:]]' match with '&': " << std::boolalpha << std::regex_match("&", pattern) << std::endl; }