A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/algorithm/../ranges/../regex/match_results.html below:

std::match_results - cppreference.com

The class template std::match_results holds a collection of character sequences that represent the result of a regular expression match.

This is a specialized allocator-aware container. It can only be default created, obtained from std::regex_iterator, or modified by std::regex_search or std::regex_match. Because std::match_results holds std::sub_matches, each of which is a pair of iterators into the original character sequence that was matched, it's undefined behavior to examine std::match_results if the original character sequence was destroyed or iterators to it were invalidated for other reasons.

The first std::sub_match (index 0) contained in a std::match_result always represents the full match within a target sequence made by a regex, and subsequent std::sub_matches represent sub-expression matches corresponding in sequence to the left parenthesis delimiting the sub-expression in the regex.

std::match_results meets the requirements of a AllocatorAwareContainer and of a SequenceContainer, except that only copy assignment, move assignment, and operations defined for a constant containers are supported, and that the semantics of comparison functions are different from those required for a container.

[edit] Type requirements [edit] Specializations

Several specializations for common character sequence types are provided:

Type Definition std::cmatch std::match_results<const char*> std::wcmatch std::match_results<const wchar_t*> std::smatch std::match_results<std::string::const_iterator> std::wsmatch std::match_results<std::wstring::const_iterator> std::pmr::cmatch (C++17) std::pmr::match_results<const char*> std::pmr::wcmatch (C++17) std::pmr::match_results<const wchar_t*> std::pmr::smatch (C++17) std::pmr::match_results<std::string::const_iterator> std::pmr::wsmatch (C++17) std::pmr::match_results<std::wstring::const_iterator> [edit] Member types [edit] Member functions constructs the object
(public member function) [edit] destructs the object
(public member function) [edit] assigns the contents
(public member function) [edit] returns the associated allocator
(public member function) [edit] State checks if the results are available
(public member function) Size checks whether the match was successful
(public member function) [edit] returns the number of matches in a fully-established result state
(public member function) [edit] returns the maximum possible number of sub-matches
(public member function) [edit] Element access returns the length of the particular sub-match
(public member function) [edit] returns the position of the first character of the particular sub-match
(public member function) [edit] returns the sequence of characters for the particular sub-match
(public member function) [edit] returns specified sub-match
(public member function) [edit] returns sub-sequence between the beginning of the target sequence and the beginning of the full match
(public member function) [edit] returns sub-sequence between the end of the full match and the end of the target sequence
(public member function) [edit] Iterators returns iterator to the beginning of the list of sub-matches
(public member function) [edit] returns iterator to the end of the list of sub-matches
(public member function) [edit] Format formats match results for output
(public member function) [edit] Modifiers swaps the contents
(public member function) [edit] [edit] Non-member functions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4