We learned about std::match_results. Now, we will look at one of the functions which allow us to send data to match_results.

std::regex_match determines if text matches a text pattern. You can further analyze the search result of type std::match_results.

The code snippet below shows three simple applications of std::regex_match: a C string, a C++ string and a range returning only a boolean. The three variants are available for std::match_results objects respectively.

Get hands-on with 1000+ tech skills courses.