Header Reference: <regex>
Header Reference: <regex>
Regular expression types, match results, iterators, and algorithms provided by <regex>.
Header Reference: <regex>
Regular expression types, match results, iterators, and algorithms provided by <regex>.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
Header reference pages are meant to answer a practical question quickly: what this header provides, when to reach for it, and which usage rules are easiest to get wrong.
<regex>std::basic_regexstd::regexstd::wregexstd::sub_matchstd::match_resultsstd::smatch, std::cmatchstd::regex_matchstd::regex_searchstd::regex_replacestd::regex_iteratorstd::regex_token_iteratorstd::regex_constantsUse <regex> when you need declarative pattern matching over strings and character ranges.
#include <regex>
#include <string>
int main() {
std::regex pattern{"[a-z]+"};
return std::regex_match(std::string{"token"}, pattern) ? 0 : 1;
}