#include #include #include int main() { std::regex pattern { "[a-e]" }; std::cout << "'[a-e]' match with '': " << std::boolalpha << std::regex_match("", pattern) << std::endl; std::cout << "'[a-e]' match with 'a': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'[a-e]' match with 'e': " << std::boolalpha << std::regex_match("e", pattern) << std::endl; std::cout << "'[a-e]' match with 'z': " << std::boolalpha << std::regex_match("z", pattern) << std::endl; std::cout << "'[a-e]' match with 'ab': " << std::boolalpha << std::regex_match("ab", pattern) << std::endl; pattern = "ab[c-f]"; std::cout << "'ab[c-f]' match with '': " << std::boolalpha << std::regex_match("", pattern) << std::endl; std::cout << "'ab[c-f]' match with 'abc': " << std::boolalpha << std::regex_match("abc", pattern) << std::endl; std::cout << "'ab[c-f]' match with 'abz': " << std::boolalpha << std::regex_match("abz", pattern) << std::endl; }