libstdc++: std::match_results< _Bi_iter, _Alloc > Class Template Reference (original) (raw)
#include <[regex](a00176%5Fsource.html)>
Public Types | |
---|---|
28.10 Public Types | |
typedef sub_match< _Bi_iter > | value_type |
typedef const value_type & | const_reference |
typedef value_type & | reference |
typedef _Base_type::const_iterator | const_iterator |
typedef const_iterator | iterator |
typedef __iter_traits::difference_type | difference_type |
typedef allocator_traits< _Alloc >::size_type | size_type |
typedef _Alloc | allocator_type |
typedef __iter_traits::value_type | char_type |
typedef std::basic_string< char_type > | string_type |
Public Member Functions | |
---|---|
template<typename _Out_iter > | |
_Out_iter | format (_Out_iter __out, const match_results< _Bi_iter, _Alloc >::char_type *__fmt_first, const match_results< _Bi_iter, _Alloc >::char_type *__fmt_last, match_flag_type __flags) const |
bool | ready () const noexcept |
28.10.1 Construction, Copying, and Destruction | |
match_results () | |
match_results (const _Alloc &__a) noexcept | |
match_results (const match_results &)=default | |
match_results (match_results &&) noexcept=default | |
match_results & | operator= (const match_results &)=default |
match_results & | operator= (match_results &&)=default |
~match_results ()=default | |
match_results (const match_results &__m, const _Alloc &__a) | |
match_results (match_results &&__m, const _Alloc &__a) noexcept(noexcept(_Base_type(std::move(__m), __a))) | |
28.10.2 Size | |
size_type | size () const noexcept |
size_type | max_size () const noexcept |
bool | empty () const noexcept |
28.10.4 Element Access | |
difference_type | length (size_type __sub=0) const |
difference_type | position (size_type __sub=0) const |
string_type | str (size_type __sub=0) const |
const_reference | operator[] (size_type __sub) const |
const_reference | prefix () const |
const_reference | suffix () const |
const_iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | end () const noexcept |
const_iterator | cend () const noexcept |
28.10.5 Formatting | |
These functions perform formatted substitution of the matched character sequences into their target. The format specifiers and escape sequences accepted by these functions are determined by their flags parameter as documented above. | |
template<typename _Out_iter > | |
_Out_iter | format (_Out_iter __out, const char_type *__fmt_first, const char_type *__fmt_last, match_flag_type __flags=regex_constants::format_default) const |
template<typename _Out_iter , typename _St , typename _Sa > | |
_Out_iter | format (_Out_iter __out, const basic_string< char_type, _St, _Sa > &__fmt, match_flag_type __flags=regex_constants::format_default) const |
template<typename _St , typename _Sa > | |
basic_string< char_type, _St, _Sa > | format (const basic_string< char_type, _St, _Sa > &__fmt, match_flag_type __flags=regex_constants::format_default) const |
string_type | format (const char_type *__fmt, match_flag_type __flags=regex_constants::format_default) const |
28.10.6 Allocator | |
allocator_type | get_allocator () const noexcept |
28.10.7 Swap | |
void | swap (match_results &__that) noexcept |
Private Member Functions | |
---|---|
constexpr iterator | begin () noexcept |
constexpr iterator | end () noexcept |
constexpr const_reference | operator[] (size_type __n) const noexcept |
constexpr reference | operator[] (size_type __n) noexcept |
constexpr void | swap (vector &__x) noexcept |
Friends | |
---|---|
template<typename , typename , typename > | |
class | regex_iterator |
Related Symbols | |
---|---|
(Note that these are not member symbols.) | |
template<typename _Bi_iter , typename _Alloc > | |
bool | operator== (const match_results< _Bi_iter, _Alloc > &__m1, const match_results< _Bi_iter, _Alloc > &__m2) |
template<typename _Bi_iter , typename _Alloc > | |
void | swap (match_results< _Bi_iter, _Alloc > &__lhs, match_results< _Bi_iter, _Alloc > &__rhs) noexcept |
template<typename _Bi_iter, typename _Alloc = allocator<sub_match<_Bi_iter> >>
class std::match_results< _Bi_iter, _Alloc >
The results of a match or search operation.
A collection of character sequences representing the result of a regular expression match. Storage for the collection is allocated and freed as necessary by the member functions of class template match_results.
This class satisfies the Sequence requirements, with the exception that only the operations defined for a const-qualified Sequence are supported.
The sub_match object stored at index 0 represents sub-expression 0, i.e. the whole match. In this case the sub_match member matched is always true. The sub_match object stored at index n denotes what matched the marked sub-expression n within the matched expression. If the sub-expression n participated in a regular expression match then the sub_match member matched evaluates to true, and members first and second denote the range of characters [first, second) which formed that match. Otherwise matched is false, and members first and second point to the end of the sequence that was searched.
Since
C++11
Definition at line 1748 of file regex.h.
◆ allocator_type
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ char_type
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ const_iterator
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ const_reference
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ difference_type
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
typedef __iter_traits::difference_type std::match_results< _Bi_iter, _Alloc >::difference_type
◆ iterator
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ size_type
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ string_type
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ value_type
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ match_results() [1/6]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Constructs a default match_results container.
Postcondition
size() returns 0 and str() returns an empty string.
Definition at line 1801 of file regex.h.
◆ match_results() [2/6]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
std::match_results< _Bi_iter, _Alloc >::match_results ( const _Alloc & __a) | inlineexplicitnoexcept |
---|
Constructs a default match_results container.
Postcondition
size() returns 0 and str() returns an empty string.
Definition at line 1808 of file regex.h.
◆ match_results() [3/6]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Copy constructs a match_results.
◆ match_results() [4/6]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Move constructs a match_results.
◆ ~match_results()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Destroys a match_results object.
◆ match_results() [5/6]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Constructs a default match_results container.
Postcondition
size() returns 0 and str() returns an empty string.
Definition at line 1842 of file regex.h.
◆ match_results() [6/6]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Constructs a default match_results container.
Postcondition
size() returns 0 and str() returns an empty string.
Definition at line 1845 of file regex.h.
◆ begin()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ cbegin()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ cend()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ empty()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ end()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ format() [1/5]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
template<typename _Out_iter , typename _St , typename _Sa >
◆ format() [2/5]
◆ format() [3/5]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
template<typename _Out_iter >
_Out_iter std::match_results< _Bi_iter, _Alloc >::format | ( | _Out_iter | __out, |
---|---|---|---|
const match_results< _Bi_iter, _Alloc >::char_type * | __fmt_first, | ||
const match_results< _Bi_iter, _Alloc >::char_type * | __fmt_last, | ||
match_flag_type | __flags | ||
) | const |
◆ format() [4/5]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
template<typename _St , typename _Sa >
◆ format() [5/5]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ get_allocator()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
allocator_type std::match_results< _Bi_iter, _Alloc >::get_allocator ( ) const | inlinenoexcept |
---|
◆ length()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
difference_type std::match_results< _Bi_iter, _Alloc >::length ( size_type __sub = 0) const | inline |
---|
Gets the length of the indicated submatch.
Parameters
__sub | indicates the submatch. |
---|
Precondition
ready() == true
This function returns the length of the indicated submatch, or the length of the entire match if __sub
is zero (the default).
Definition at line 1906 of file regex.h.
◆ max_size()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Gets the number of matches and submatches.
The number of matches for a given regular expression will be either 0 if there was no match or mark_count() + 1 if a match was successful. Some matches may be empty.
Returns
the number of matches found.
Definition at line 1878 of file regex.h.
References std::vector< _Tp, _Alloc >::max_size().
◆ operator=() [1/2]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Assigns rhs to *this.
◆ operator=() [2/2]
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Move-assigns rhs to *this.
◆ operator[]()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ position()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
difference_type std::match_results< _Bi_iter, _Alloc >::position ( size_type __sub = 0) const | inline |
---|
Gets the offset of the beginning of the indicated submatch.
Parameters
__sub | indicates the submatch. |
---|
Precondition
ready() == true
This function returns the offset from the beginning of the target sequence to the beginning of the submatch, unless the value of __sub
is zero (the default), in which case this function returns the offset from the beginning of the target sequence to the beginning of the match.
Definition at line 1921 of file regex.h.
References std::distance().
◆ prefix()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ ready()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ size()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ str()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
Gets the match or submatch converted to a string type.
Parameters
__sub | indicates the submatch. |
---|
Precondition
ready() == true
This function gets the submatch (or match, if __sub
is zero) extracted from the target range and converted to the associated string type.
Definition at line 1934 of file regex.h.
◆ suffix()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ swap()
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
◆ regex_iterator
template<typename _Bi_iter , typename _Alloc = allocator<sub_match<_Bi_iter> >>
template<typename , typename , typename >
The documentation for this class was generated from the following files: