Difference between revisions of "cpp/regex"
(more templates) |
(added typedefs) |
||
Line 6: | Line 6: | ||
Also provided in the regular expressions library are utility classes that provide support for various algorithms, iterators, exceptions, and type traits. | Also provided in the regular expressions library are utility classes that provide support for various algorithms, iterators, exceptions, and type traits. | ||
− | ===Main | + | ===Main types=== |
These classes encapsulate a regular expression and the results of matching a regular expression within a target sequence of characters. | These classes encapsulate a regular expression and the results of matching a regular expression within a target sequence of characters. | ||
Line 15: | Line 15: | ||
{{dcl list template | cpp/regex/dcl list match_results }} | {{dcl list template | cpp/regex/dcl list match_results }} | ||
{{dcl list end}} | {{dcl list end}} | ||
+ | |||
+ | Two typedefs are also provided for narrow and wide character types: | ||
+ | |||
+ | {{tdcl list begin}} | ||
+ | {{tdcl list hitem | Type | Definition}} | ||
+ | {{tdcl list item | {{tt|regex}} | {{c|basic_regex<char>}} | notes={{mark since c++11}} }} | ||
+ | {{tdcl list item | {{tt|wregex}} | {{c|basic_regex<wchar_t>}} | notes={{mark since c++11}} }} | ||
+ | {{tdcl list end}} | ||
===Algorithms=== | ===Algorithms=== |
Revision as of 09:28, 8 May 2012
The regular expressions library provides a class that represents regular expressions, which are a kind of mini-language used to perform pattern matching within strings.
Also provided in the regular expressions library are utility classes that provide support for various algorithms, iterators, exceptions, and type traits.
Contents |
Main types
These classes encapsulate a regular expression and the results of matching a regular expression within a target sequence of characters.
(C++11) |
identifies a sub match in the analyzed string (class template) |
Two typedefs are also provided for narrow and wide character types:
Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end
Algorithms
These functions are used to apply the regular expression encapsulated in a regex to a target sequence of characters..
(C++11) |
try to match a regular expression with a complete string (function template) |
(C++11) |
check if a regular expression occurs anywhere within a string (function template) |
(C++11) |
replace occurrences of a regular expression with some other text (function template) |
Iterators
The regex iterators are used to traverse the entire set of regular expression matches found within a sequence.
(C++11) |
(class template) |
(C++11) |
(class template) |
Exceptions
This class defines the type of objects thrown as exceptions to report errors from the regular expressions library.
(C++11) |
(class) |
Traits
The regex traits class is used to encapsulate the localizable aspects of a regex.
(C++11) |
(class template) |
Constants
Defined in namespace
std::regex_constants |