std::regex — regular expressions library.
1#include <regex>23std::regex email_pattern(R"(\w+@\w+\.\w+)");45std::string text = "Contact: user@example.com";6std::smatch match;78if (std::regex_search(text, match, email_pattern)) {9 std::cout << "Found: " << match[0];10}
Operations:
regex_search: find match anywhereregex_match: match entire stringregex_replace: replace matchessregex_iterator: iterate over all matchesWarning: