#####  [ cppreference.com ](/)

[ Log in ](/mwiki/index.php?title=Special:UserLogin&returnto=cpp%2Fregex "You
are encouraged to log in; however, it is not mandatory \[o\]")

#####  Namespaces

  * [ Page ](/w/cpp/regex "View the content page \[c\]")
  * [ Discussion ](/w/Talk:cpp/regex "Discussion about the content page \[t\]")

#####  Variants

#####  Views

  * [ View ](/w/cpp/regex)
  * [ Edit ](/mwiki/index.php?title=cpp/regex&action=edit "You can edit this page. Please use the preview button before saving \[e\]")
  * [ History ](/mwiki/index.php?title=cpp/regex&action=history "Past revisions of this page \[h\]")

#####  Actions

#  Regular expressions library  (since C++11)

From cppreference.com

< [ cpp ](/w/cpp "cpp")

[ C++ ](/w/cpp "cpp")

[ Compiler support ](/w/cpp/compiler_support "cpp/compiler support")  
---  
[ Freestanding and hosted ](/w/cpp/freestanding "cpp/freestanding")  
[ Language ](/w/cpp/language "cpp/language")  
[ Standard library ](/w/cpp/standard_library "cpp/standard library")  
[ Standard library headers ](/w/cpp/header "cpp/header")  
[ Named requirements ](/w/cpp/named_req "cpp/named req")  
[ Feature test macros ](/w/cpp/feature_test "cpp/feature test") (C++20)  
[ Language support library ](/w/cpp/utility#Language_support "cpp/utility")  
[ Concepts library ](/w/cpp/concepts "cpp/concepts") (C++20)  
[ Metaprogramming library ](/w/cpp/meta "cpp/meta") (C++11)  
[ Diagnostics library ](/w/cpp/error "cpp/error")  
[ General utilities library ](/w/cpp/utility "cpp/utility")  
[ Strings library ](/w/cpp/string "cpp/string")  
[ Containers library ](/w/cpp/container "cpp/container")  
[ Iterators library ](/w/cpp/iterator "cpp/iterator")  
[ Ranges library ](/w/cpp/ranges "cpp/ranges") (C++20)  
[ Algorithms library ](/w/cpp/algorithm "cpp/algorithm")  
[ Numerics library ](/w/cpp/numeric "cpp/numeric")  
[ Localizations library ](/w/cpp/locale "cpp/locale")  
[ Input/output library ](/w/cpp/io "cpp/io")  
[ Filesystem library ](/w/cpp/filesystem "cpp/filesystem") (C++17)  
**Regular expressions library** (C++11)  
[ Concurrency support library ](/w/cpp/thread "cpp/thread") (C++11)  
[ Technical specifications ](/w/cpp/experimental "cpp/experimental")  
[ Symbols index ](/w/cpp/symbol_index "cpp/symbol index")  
[ External libraries ](/w/cpp/links/libs "cpp/links/libs")  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/navbar_content&action=edit)

**Regular expressions library**

Classes  
---  
[ basic_regex  ](/w/cpp/regex/basic_regex "cpp/regex/basic regex") (C++11)  
[ sub_match  ](/w/cpp/regex/sub_match "cpp/regex/sub match") (C++11)  
[ match_results  ](/w/cpp/regex/match_results "cpp/regex/match results")
(C++11)  
Algorithms  
[ regex_match  ](/w/cpp/regex/regex_match "cpp/regex/regex match") (C++11)  
[ regex_search  ](/w/cpp/regex/regex_search "cpp/regex/regex search") (C++11)  
[ regex_replace  ](/w/cpp/regex/regex_replace "cpp/regex/regex replace")
(C++11)  
Iterators  
[ regex_iterator  ](/w/cpp/regex/regex_iterator "cpp/regex/regex iterator")
(C++11)  
[ regex_token_iterator  ](/w/cpp/regex/regex_token_iterator "cpp/regex/regex
token iterator") (C++11)  
Exceptions  
[ regex_error  ](/w/cpp/regex/regex_error "cpp/regex/regex error") (C++11)  
Traits  
[ regex_traits  ](/w/cpp/regex/regex_traits "cpp/regex/regex traits") (C++11)  
Constants  
[ syntax_option_type  ](/w/cpp/regex/syntax_option_type "cpp/regex/syntax
option type") (C++11)  
[ match_flag_type  ](/w/cpp/regex/match_flag_type "cpp/regex/match flag type")
(C++11)  
[ error_type  ](/w/cpp/regex/error_type "cpp/regex/error type") (C++11)  
Regex Grammar  
[ Modified ECMAScript-262  ](/w/cpp/regex/ecmascript "cpp/regex/ecmascript")
(C++11)  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/regex/navbar_content&action=edit)

The regular expressions library provides a class that represents [ regular
expressions ](https://en.wikipedia.org/wiki/Regular_expression "enwiki:Re