#include #include #include int main() { std::regex pattern { "." }; std::cout << "'.' match with '': " << std::boolalpha << std::regex_match("", pattern) << std::endl; std::cout << "'.' match with 'a': " << std::boolalpha << std::regex_match("a", pattern) << std::endl; std::cout << "'.' match with 'ab': " << std::boolalpha << std::regex_match("ab", pattern) << std::endl; pattern = "abc"; std::cout << "'abc' match with 'abc': " << std::boolalpha << std::regex_match("abc", pattern) << std::endl; std::cout << "'abc' match with 'a$c': " << std::boolalpha << std::regex_match("a$c", pattern) << std::endl; pattern = "a.c"; std::cout << "'a.c' match with 'abc': " << std::boolalpha << std::regex_match("abc", pattern) << std::endl; std::cout << "'a.c' match with 'a$c': " << std::boolalpha << std::regex_match("a$c", pattern) << std::endl; }