#include #include int main() { std::regex pattern { "a{3}" }; std::cout << "'a{3}' match with '': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'a{3}' match with 'aaaa': " << std::boolalpha << std::regex_match("aaaa", pattern) << std::endl; std::cout << "'a{3}' match with 'aaaaaaaa': " << std::boolalpha << std::regex_match("aaaaaaaa", pattern) << std::endl << std::endl; pattern = "a{3,}"; std::cout << "'a{3,}' match with '': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'a{3,}' match with 'aaaa': " << std::boolalpha << std::regex_match("aaaa", pattern) << std::endl; std::cout << "'a{3,}' match with 'aaaaaaaa': " << std::boolalpha << std::regex_match("aaaaaaaa", pattern) << std::endl << std::endl; pattern = "a{3,5}"; std::cout << "'a{3,5}' match with '': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'a{3,5}' match with 'aaaa': " << std::boolalpha << std::regex_match("aaaa", pattern) << std::endl; std::cout << "'a{3,5}' match with 'aaaaaaaa': " << std::boolalpha << std::regex_match("aaaaaaaa", pattern) << std::endl; }