<regex> library in C++ STL
Main classes
These classes encapsulate a regular expression and the results of matching a regular expression within a target sequence of characters.
- basic_regex: Regular expression object (class template)
- sub_match: Identifies the sequence of characters matched by a sub-expression (class template)
- match_results: Identifies one regular expression match, including all sub-expression matches (class template)
Algorithms
These functions are used to apply the regular expression encapsulated in a regex to a target sequence of characters.
- regex_match: Attempts to match a regular expression to an entire character sequence (function template)
- regex_search: Attempts to match a regular expression to any part of a character sequence. (function template)
- regex_replace: Replaces occurrences of a regular expression with formatted replacement text. (function template)
Iterators
The regex iterators are used to traverse the entire set of regular expression matches found within a sequence.
- regex_iterator: Iterates through all regex matches within a character sequence. (class template)
- regex_token_iterator: Iterates through the specified sub-expressions within all regex matches in a given string or through unmatched substrings (class template)
Exceptions
This class defines the type of objects thrown as exceptions to report errors from the regular expressions library.
- regex_error: Reports errors generated by the regular expressions library. (class)
Traits
The regex traits class is used to encapsulate the localizable aspects of a regex.
- regex_traits: Provides metainformation about a character type, required by the regex library. (class template)
More Useful Links
- Recent Articles on C++
- Coding Practice Platform
- Multiple Choice Questions
- All articles in C++ Category
Recommended Posts:
- snprintf() in C library
- <iterator> library in C++ STL
- SDL library in C/C++ with examples
- <strings> library in C++ STL
- <algorithms> library in C++ STL
- <numeric> library in C++ STL
- boost::split in C++ library
- Any datatype in C++ boost library
- Pattern Searching using C++ library
- Set in C++ Standard Template Library (STL)
- The C++ Standard Template Library (STL)
- Map in C++ Standard Template Library (STL)
- difftime() C library function
- Advanced C++ with boost library
- boost::algorithm::any_of() in C++ library
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



