#include #include #include int main() { std::regex const pattern { "[abc]" }; std::cout << "'[abc]' match with '': " << std::boolalpha << std::regex_match("", pattern) << std::endl; std::cout << "'[abc]' match with 'a': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'[abc]' match with 'b': " << std::boolalpha << std::regex_match("b", pattern) << std::endl; std::cout << "'[abc]' match with 'z': " << std::boolalpha << std::regex_match("z", pattern) << std::endl; std::cout << "'[abc]' match with 'ab': " << std::boolalpha << std::regex_match("ab", pattern) << std::endl; }