.TH "std::match_results< _Bi_iter, _Alloc >" 3cxx "Wed Jul 14 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::match_results< _Bi_iter, _Alloc > \- The results of a match or search operation\&. .SH SYNOPSIS .br .PP .PP Inherits \fBstd::vector< sub_match< _Bi_iter >, allocator< sub_match< _Bi_iter > > >\fP\&. .SS "Public Types" .PP .RI "\fB28\&.10 Public Types\fP" .br .in +1c .in +1c .ti -1c .RI "typedef \fBsub_match\fP< _Bi_iter > \fBvalue_type\fP" .br .ti -1c .RI "typedef const \fBvalue_type\fP & \fBconst_reference\fP" .br .ti -1c .RI "typedef \fBvalue_type\fP & \fBreference\fP" .br .ti -1c .RI "typedef _Base_type::const_iterator \fBconst_iterator\fP" .br .ti -1c .RI "typedef const_iterator \fBiterator\fP" .br .ti -1c .RI "typedef __iter_traits::difference_type \fBdifference_type\fP" .br .ti -1c .RI "typedef \fBallocator_traits\fP< _Alloc >::size_type \fBsize_type\fP" .br .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef __iter_traits::value_type \fBchar_type\fP" .br .ti -1c .RI "typedef \fBstd::basic_string\fP< char_type > \fBstring_type\fP" .br .in -1c .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "bool \fBready\fP () const noexcept" .br .RI "Indicates if the match_results is ready\&. " .in -1c .PP .RI "\fB28\&.10\&.1 Construction, Copying, and Destruction\fP" .br .in +1c .in +1c .ti -1c .RI "\fBmatch_results\fP ()" .br .RI "Constructs a default match_results container\&. " .ti -1c .RI "\fBmatch_results\fP (const _Alloc &__a) noexcept" .br .RI "Constructs a default match_results container\&. " .ti -1c .RI "\fBmatch_results\fP (const \fBmatch_results\fP &)=default" .br .RI "Copy constructs a match_results\&. " .ti -1c .RI "\fBmatch_results\fP (\fBmatch_results\fP &&) noexcept=default" .br .RI "Move constructs a match_results\&. " .ti -1c .RI "\fBmatch_results\fP & \fBoperator=\fP (const \fBmatch_results\fP &)=default" .br .RI "Assigns rhs to *this\&. " .ti -1c .RI "\fBmatch_results\fP & \fBoperator=\fP (\fBmatch_results\fP &&)=default" .br .RI "Move-assigns rhs to *this\&. " .ti -1c .RI "\fB~match_results\fP ()=default" .br .RI "Destroys a match_results object\&. " .in -1c .in -1c .PP .RI "\fB28\&.10\&.2 Size\fP" .br .in +1c .in +1c .ti -1c .RI "size_type \fBsize\fP () const noexcept" .br .RI "Gets the number of matches and submatches\&. " .ti -1c .RI "size_type \fBmax_size\fP () const noexcept" .br .RI "Gets the number of matches and submatches\&. " .ti -1c .RI "bool \fBempty\fP () const noexcept" .br .RI "Indicates if the match_results contains no results\&. " .in -1c .in -1c .PP .RI "\fB28\&.10\&.4 Element Access\fP" .br .in +1c .in +1c .ti -1c .RI "difference_type \fBlength\fP (size_type __sub=0) const" .br .RI "Gets the length of the indicated submatch\&. " .ti -1c .RI "difference_type \fBposition\fP (size_type __sub=0) const" .br .RI "Gets the offset of the beginning of the indicated submatch\&. " .ti -1c .RI "\fBstring_type\fP \fBstr\fP (size_type __sub=0) const" .br .RI "Gets the match or submatch converted to a string type\&. " .ti -1c .RI "\fBconst_reference\fP \fBoperator[]\fP (size_type __sub) const" .br .RI "Gets a sub_match reference for the match or submatch\&. " .ti -1c .RI "\fBconst_reference\fP \fBprefix\fP () const" .br .RI "Gets a sub_match representing the match prefix\&. " .ti -1c .RI "\fBconst_reference\fP \fBsuffix\fP () const" .br .RI "Gets a sub_match representing the match suffix\&. " .ti -1c .RI "const_iterator \fBbegin\fP () const noexcept" .br .RI "Gets an iterator to the start of the sub_match collection\&. " .ti -1c .RI "const_iterator \fBcbegin\fP () const noexcept" .br .RI "Gets an iterator to the start of the sub_match collection\&. " .ti -1c .RI "const_iterator \fBend\fP () const noexcept" .br .RI "Gets an iterator to one-past-the-end of the collection\&. " .ti -1c .RI "const_iterator \fBcend\fP () const noexcept" .br .RI "Gets an iterator to one-past-the-end of the collection\&. " .in -1c .in -1c .PP .RI "\fB28\&.10\&.5 Formatting\fP" .br 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 \fCflags\fP parameter as documented above\&. .PP .in +1c .in +1c .ti -1c .RI "template _Out_iter \fBformat\fP (_Out_iter __out, const char_type *__fmt_first, const char_type *__fmt_last, \fBmatch_flag_type\fP __flags=\fBregex_constants::format_default\fP) const" .br .ti -1c .RI "template _Out_iter \fBformat\fP (_Out_iter __out, const \fBbasic_string\fP< char_type, _St, _Sa > &__fmt, \fBmatch_flag_type\fP __flags=\fBregex_constants::format_default\fP) const" .br .ti -1c .RI "template \fBbasic_string\fP< char_type, _St, _Sa > \fBformat\fP (const \fBbasic_string\fP< char_type, _St, _Sa > &__fmt, \fBmatch_flag_type\fP __flags=\fBregex_constants::format_default\fP) const" .br .ti -1c .RI "\fBstring_type\fP \fBformat\fP (const char_type *__fmt, \fBmatch_flag_type\fP __flags=\fBregex_constants::format_default\fP) const" .br .in -1c .in -1c .PP .RI "\fB28\&.10\&.6 Allocator\fP" .br .in +1c .in +1c .ti -1c .RI "allocator_type \fBget_allocator\fP () const noexcept" .br .RI "Gets a copy of the allocator\&. " .in -1c .in -1c .PP .RI "\fB28\&.10\&.7 Swap\fP" .br .in +1c .in +1c .ti -1c .RI "void \fBswap\fP (\fBmatch_results\fP &__that) noexcept" .br .RI "Swaps the contents of two match_results\&. " .in -1c .in -1c .SS "Private Member Functions" .in +1c .ti -1c .RI "iterator \fBbegin\fP () noexcept" .br .ti -1c .RI "iterator \fBend\fP () noexcept" .br .ti -1c .RI "allocator_type \fBget_allocator\fP () const noexcept" .br .RI "Get a copy of the memory allocation object\&. " .ti -1c .RI "\fBconst_reference\fP \fBoperator[]\fP (size_type __n) const noexcept" .br .RI "Subscript access to the data contained in the vector\&. " .ti -1c .RI "\fBreference\fP \fBoperator[]\fP (size_type __n) noexcept" .br .RI "Subscript access to the data contained in the vector\&. " .ti -1c .RI "void \fBswap\fP (\fBvector\fP &__x) noexcept" .br .RI "Swaps data with another vector\&. " .in -1c .SS "Friends" .in +1c .ti -1c .RI "template class \fBregex_iterator\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template >> .br 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\&. .PP This class satisfies the Sequence requirements, with the exception that only the operations defined for a const-qualified Sequence are supported\&. .PP 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\&. .PP Definition at line 1677 of file regex\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template >> \fBstd::match_results\fP< _Bi_iter, _Alloc >::\fBmatch_results\fP ()\fC [inline]\fP" .PP Constructs a default match_results container\&. .PP \fBPostcondition\fP .RS 4 size() returns 0 and str() returns an empty string\&. .RE .PP .PP Definition at line 1728 of file regex\&.h\&. .SS "template >> \fBstd::match_results\fP< _Bi_iter, _Alloc >::\fBmatch_results\fP (const _Alloc & __a)\fC [inline]\fP, \fC [explicit]\fP, \fC [noexcept]\fP" .PP Constructs a default match_results container\&. .PP \fBPostcondition\fP .RS 4 size() returns 0 and str() returns an empty string\&. .RE .PP .PP Definition at line 1735 of file regex\&.h\&. .SS "template >> \fBstd::match_results\fP< _Bi_iter, _Alloc >::\fBmatch_results\fP (const \fBmatch_results\fP< _Bi_iter, _Alloc > &)\fC [default]\fP" .PP Copy constructs a match_results\&. .SS "template >> \fBstd::match_results\fP< _Bi_iter, _Alloc >::\fBmatch_results\fP (\fBmatch_results\fP< _Bi_iter, _Alloc > &&)\fC [default]\fP, \fC [noexcept]\fP" .PP Move constructs a match_results\&. .SS "template >> \fBstd::match_results\fP< _Bi_iter, _Alloc >::~\fBmatch_results\fP ()\fC [default]\fP" .PP Destroys a match_results object\&. .SH "Member Function Documentation" .PP .SS "template >> const_iterator \fBstd::match_results\fP< _Bi_iter, _Alloc >::begin () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Gets an iterator to the start of the sub_match collection\&. .PP Definition at line 1908 of file regex\&.h\&. .PP References std::vector< _Tp, _Alloc >::begin()\&. .PP Referenced by std::match_results< _Bi_iter, _Alloc >::cbegin(), and std::operator==()\&. .SS "template >> const_iterator \fBstd::match_results\fP< _Bi_iter, _Alloc >::cbegin () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Gets an iterator to the start of the sub_match collection\&. .PP Definition at line 1915 of file regex\&.h\&. .PP References std::match_results< _Bi_iter, _Alloc >::begin()\&. .SS "template >> const_iterator \fBstd::match_results\fP< _Bi_iter, _Alloc >::cend () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Gets an iterator to one-past-the-end of the collection\&. .PP Definition at line 1929 of file regex\&.h\&. .PP References std::match_results< _Bi_iter, _Alloc >::end()\&. .SS "template >> bool \fBstd::match_results\fP< _Bi_iter, _Alloc >::empty () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Indicates if the match_results contains no results\&. .PP \fBReturn values\fP .RS 4 \fItrue\fP The match_results object is empty\&. .br \fIfalse\fP The match_results object is not empty\&. .RE .PP .PP Definition at line 1804 of file regex\&.h\&. .PP References std::match_results< _Bi_iter, _Alloc >::size()\&. .PP Referenced by std::match_results< _Bi_iter, _Alloc >::end(), and std::operator==()\&. .SS "template >> const_iterator \fBstd::match_results\fP< _Bi_iter, _Alloc >::end () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Gets an iterator to one-past-the-end of the collection\&. .PP Definition at line 1922 of file regex\&.h\&. .PP References std::match_results< _Bi_iter, _Alloc >::empty(), and std::vector< _Tp, _Alloc >::end()\&. .PP Referenced by std::match_results< _Bi_iter, _Alloc >::cend(), and std::operator==()\&. .SS "template >> template _Out_iter \fBstd::match_results\fP< _Bi_iter, _Alloc >::format (_Out_iter __out, const \fBbasic_string\fP< char_type, _St, _Sa > & __fmt, \fBmatch_flag_type\fP __flags = \fC\fBregex_constants::format_default\fP\fP) const\fC [inline]\fP" .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP .PP Definition at line 1958 of file regex\&.h\&. .PP References std::basic_string< _CharT, _Traits, _Alloc >::data(), std::match_results< _Bi_iter, _Alloc >::format(), and std::basic_string< _CharT, _Traits, _Alloc >::size()\&. .SS "template >> template _Out_iter \fBstd::match_results\fP< _Bi_iter, _Alloc >::format (_Out_iter __out, const char_type * __fmt_first, const char_type * __fmt_last, \fBmatch_flag_type\fP __flags = \fC\fBregex_constants::format_default\fP\fP) const" .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP .PP Referenced by std::match_results< _Bi_iter, _Alloc >::format()\&. .SS "template >> template \fBbasic_string\fP \fBstd::match_results\fP< _Bi_iter, _Alloc >::format (const \fBbasic_string\fP< char_type, _St, _Sa > & __fmt, \fBmatch_flag_type\fP __flags = \fC\fBregex_constants::format_default\fP\fP) const\fC [inline]\fP" .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP .PP Definition at line 1970 of file regex\&.h\&. .PP References std::back_inserter(), and std::match_results< _Bi_iter, _Alloc >::format()\&. .SS "template >> \fBstring_type\fP \fBstd::match_results\fP< _Bi_iter, _Alloc >::format (const char_type * __fmt, \fBmatch_flag_type\fP __flags = \fC\fBregex_constants::format_default\fP\fP) const\fC [inline]\fP" .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP .PP Definition at line 1982 of file regex\&.h\&. .PP References std::back_inserter(), and std::match_results< _Bi_iter, _Alloc >::format()\&. .SS "template >> allocator_type \fBstd::match_results\fP< _Bi_iter, _Alloc >::get_allocator () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Gets a copy of the allocator\&. .PP Definition at line 2004 of file regex\&.h\&. .PP References std::vector< _Tp, _Alloc >::get_allocator()\&. .SS "template >> difference_type \fBstd::match_results\fP< _Bi_iter, _Alloc >::length (size_type __sub = \fC0\fP) const\fC [inline]\fP" .PP Gets the length of the indicated submatch\&. .PP \fBParameters\fP .RS 4 \fI__sub\fP indicates the submatch\&. .RE .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP This function returns the length of the indicated submatch, or the length of the entire match if \fC__sub\fP is zero (the default)\&. .PP Definition at line 1823 of file regex\&.h\&. .SS "template >> size_type \fBstd::match_results\fP< _Bi_iter, _Alloc >::max_size () const\fC [inline]\fP, \fC [noexcept]\fP" .PP 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\&. .PP \fBReturns\fP .RS 4 the number of matches found\&. .RE .PP .PP Definition at line 1795 of file regex\&.h\&. .PP References std::vector< _Tp, _Alloc >::max_size()\&. .SS "template >> \fBmatch_results\fP& \fBstd::match_results\fP< _Bi_iter, _Alloc >::operator= (const \fBmatch_results\fP< _Bi_iter, _Alloc > &)\fC [default]\fP" .PP Assigns rhs to *this\&. .SS "template >> \fBmatch_results\fP& \fBstd::match_results\fP< _Bi_iter, _Alloc >::operator= (\fBmatch_results\fP< _Bi_iter, _Alloc > &&)\fC [default]\fP" .PP Move-assigns rhs to *this\&. .SS "template >> \fBconst_reference\fP \fBstd::match_results\fP< _Bi_iter, _Alloc >::operator[] (size_type __sub) const\fC [inline]\fP" .PP Gets a sub_match reference for the match or submatch\&. .PP \fBParameters\fP .RS 4 \fI__sub\fP indicates the submatch\&. .RE .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP This function gets a reference to the indicated submatch, or the entire match if \fC__sub\fP is zero\&. .PP If \fC__sub\fP >= size() then this function returns a sub_match with a special value indicating no submatch\&. .PP Definition at line 1866 of file regex\&.h\&. .SS "template >> difference_type \fBstd::match_results\fP< _Bi_iter, _Alloc >::position (size_type __sub = \fC0\fP) const\fC [inline]\fP" .PP Gets the offset of the beginning of the indicated submatch\&. .PP \fBParameters\fP .RS 4 \fI__sub\fP indicates the submatch\&. .RE .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP This function returns the offset from the beginning of the target sequence to the beginning of the submatch, unless the value of \fC__sub\fP 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\&. .PP Definition at line 1838 of file regex\&.h\&. .PP References std::distance()\&. .SS "template >> \fBconst_reference\fP \fBstd::match_results\fP< _Bi_iter, _Alloc >::prefix () const\fC [inline]\fP" .PP Gets a sub_match representing the match prefix\&. .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP This function gets a reference to a sub_match object representing the part of the target range between the start of the target range and the start of the match\&. .PP Definition at line 1883 of file regex\&.h\&. .PP Referenced by std::operator==()\&. .SS "template >> bool \fBstd::match_results\fP< _Bi_iter, _Alloc >::ready () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Indicates if the match_results is ready\&. .PP \fBReturn values\fP .RS 4 \fItrue\fP The object has a fully-established result state\&. .br \fIfalse\fP The object is not ready\&. .RE .PP .PP Definition at line 1774 of file regex\&.h\&. .PP References std::vector< _Tp, _Alloc >::empty()\&. .PP Referenced by std::operator==()\&. .SS "template >> size_type \fBstd::match_results\fP< _Bi_iter, _Alloc >::size () const\fC [inline]\fP, \fC [noexcept]\fP" .PP 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\&. .PP \fBReturns\fP .RS 4 the number of matches found\&. .RE .PP .PP Definition at line 1791 of file regex\&.h\&. .PP References std::vector< _Tp, _Alloc >::empty(), and std::vector< _Tp, _Alloc >::size()\&. .PP Referenced by std::match_results< _Bi_iter, _Alloc >::empty(), and std::operator==()\&. .SS "template >> \fBstring_type\fP \fBstd::match_results\fP< _Bi_iter, _Alloc >::str (size_type __sub = \fC0\fP) const\fC [inline]\fP" .PP Gets the match or submatch converted to a string type\&. .PP \fBParameters\fP .RS 4 \fI__sub\fP indicates the submatch\&. .RE .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP This function gets the submatch (or match, if \fC__sub\fP is zero) extracted from the target range and converted to the associated string type\&. .PP Definition at line 1851 of file regex\&.h\&. .SS "template >> \fBconst_reference\fP \fBstd::match_results\fP< _Bi_iter, _Alloc >::suffix () const\fC [inline]\fP" .PP Gets a sub_match representing the match suffix\&. .PP \fBPrecondition\fP .RS 4 ready() == true .RE .PP This function gets a reference to a sub_match object representing the part of the target range between the end of the match and the end of the target range\&. .PP Definition at line 1898 of file regex\&.h\&. .PP Referenced by std::operator==()\&. .SS "template >> void \fBstd::match_results\fP< _Bi_iter, _Alloc >::swap (\fBmatch_results\fP< _Bi_iter, _Alloc > & __that)\fC [inline]\fP, \fC [noexcept]\fP" .PP Swaps the contents of two match_results\&. .PP Definition at line 2018 of file regex\&.h\&. .PP References std::vector< _Tp, _Alloc >::swap()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.