std::match_results< _Bi_iter, _Alloc >(3cxx) | std::match_results< _Bi_iter, _Alloc >(3cxx) |
std::match_results< _Bi_iter, _Alloc > - The results of a match or search operation.
#include <regex.h>
Inherits std::vector< _Tp, _Alloc >.
match_results (const match_results
&)=default
Copy constructs a match_results. match_results (match_results
&&) noexcept=default
Move constructs a match_results. ~match_results ()=default
Destroys a match_results object. 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
match_results & operator= (const match_results
&)=default
Assigns rhs to *this. match_results & operator=
(match_results &&)=default
Move-assigns rhs to *this. bool ready () const noexcept
Indicates if the match_results is ready.
iterator begin () noexcept
iterator end () noexcept
const_reference operator[] (size_type __n) const
noexcept
Subscript access to the data contained in the vector. reference
operator[] (size_type __n) noexcept
Subscript access to the data contained in the vector. void swap
(vector &__x) noexcept
Swaps data with another vector.
template<typename _Bp , typename
_Ap , typename _Cp , typename _Rp ,
__detail::_RegexExecutorPolicy , bool > bool
__detail::__regex_algo_impl (_Bp, _Bp,
match_results< _Bp, _Ap > &, const
basic_regex< _Cp, _Rp > &,
regex_constants::match_flag_type)
template<typename , typename , typename , bool >
class __detail::_Executor
template<typename , typename , typename >
class regex_iterator
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
match_results ()
Constructs a default match_results container. match_results
(const _Alloc &__a) noexcept
Constructs a default match_results container.
size_type size () const noexcept
Gets the number of matches and submatches. size_type max_size ()
const noexcept
Gets the number of matches and submatches. _GLIBCXX_NODISCARD bool
empty () const noexcept
Indicates if the match_results contains no results.
difference_type length (size_type __sub=0)
const
Gets the length of the indicated submatch. difference_type position
(size_type __sub=0) const
Gets the offset of the beginning of the indicated submatch. string_type
str (size_type __sub=0) const
Gets the match or submatch converted to a string type. const_reference
operator[] (size_type __sub) const
Gets a sub_match reference for the match or submatch. const_reference
prefix () const
Gets a sub_match representing the match prefix. const_reference
suffix () const
Gets a sub_match representing the match suffix. const_iterator begin ()
const noexcept
Gets an iterator to the start of the sub_match collection. const_iterator
cbegin () const noexcept
Gets an iterator to the start of the sub_match collection. const_iterator
end () const noexcept
Gets an iterator to one-past-the-end of the collection. const_iterator
cend () const noexcept
Gets an iterator to one-past-the-end of the collection.
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
allocator_type get_allocator () const
noexcept
Gets a copy of the allocator.
void swap (match_results &__that)
noexcept
Swaps the contents of two match_results.
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.
Definition at line 1583 of file regex.h.
Definition at line 1619 of file regex.h.
Definition at line 1620 of file regex.h.
Definition at line 1615 of file regex.h.
Definition at line 1613 of file regex.h.
Definition at line 1617 of file regex.h.
Definition at line 1616 of file regex.h.
Definition at line 1614 of file regex.h.
Definition at line 1618 of file regex.h.
Definition at line 1621 of file regex.h.
Definition at line 1612 of file regex.h.
Constructs a default match_results container.
Postcondition
Definition at line 1635 of file regex.h.
Constructs a default match_results container.
Postcondition
Definition at line 1638 of file regex.h.
Copy constructs a match_results.
Move constructs a match_results.
Destroys a match_results object.
Gets an iterator to the start of the sub_match collection.
Definition at line 1813 of file regex.h.
Referenced by std::match_results< _Bi_iter, _Alloc >::cbegin().
Gets an iterator to the start of the sub_match collection.
Definition at line 1820 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::begin().
Gets an iterator to one-past-the-end of the collection.
Definition at line 1834 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::end().
Indicates if the match_results contains no results.
Return values
Definition at line 1709 of file regex.h.
Referenced by std::match_results< _Bi_iter, _Alloc >::prefix(), and std::match_results< _Bi_iter, _Alloc >::suffix().
Gets an iterator to one-past-the-end of the collection.
Definition at line 1827 of file regex.h.
Referenced by std::match_results< _Bi_iter, _Alloc >::cend().
Precondition
Definition at line 1863 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::format().
Precondition
Referenced by std::match_results< _Bi_iter, _Alloc >::format(), std::match_results< _Bi_iter, _Alloc >::format(), and std::match_results< _Bi_iter, _Alloc >::format().
Definition at line 355 of file regex.tcc.
Precondition
Definition at line 1875 of file regex.h.
References std::back_inserter(), and std::match_results< _Bi_iter, _Alloc >::format().
Precondition
Definition at line 1887 of file regex.h.
References std::back_inserter(), and std::match_results< _Bi_iter, _Alloc >::format().
Gets a copy of the allocator.
Definition at line 1909 of file regex.h.
Gets the length of the indicated submatch.
Parameters
Precondition
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 1728 of file regex.h.
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
Definition at line 1700 of file regex.h.
Assigns rhs to *this.
Move-assigns rhs to *this.
Gets a sub_match reference for the match or submatch.
Parameters
Precondition
This function gets a reference to the indicated submatch, or the entire match if __sub is zero.
If __sub >= size() then this function returns a sub_match with a special value indicating no submatch.
Definition at line 1771 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::ready(), and std::match_results< _Bi_iter, _Alloc >::size().
Gets the offset of the beginning of the indicated submatch.
Parameters
Precondition
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 1743 of file regex.h.
References std::distance().
Gets a sub_match representing the match prefix.
Precondition
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.
Definition at line 1788 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::empty(), and std::match_results< _Bi_iter, _Alloc >::ready().
Indicates if the match_results is ready.
Return values
Definition at line 1679 of file regex.h.
Referenced by std::match_results< _Bi_iter, _Alloc >::operator[](), std::match_results< _Bi_iter, _Alloc >::prefix(), and std::match_results< _Bi_iter, _Alloc >::suffix().
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
Definition at line 1696 of file regex.h.
Referenced by std::match_results< _Bi_iter, _Alloc >::operator[]().
Gets the match or submatch converted to a string type.
Parameters
Precondition
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 1756 of file regex.h.
Gets a sub_match representing the match suffix.
Precondition
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.
Definition at line 1803 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::empty(), and std::match_results< _Bi_iter, _Alloc >::ready().
Swaps the contents of two match_results.
Definition at line 1923 of file regex.h.
References std::match_results< _Bi_iter, _Alloc >::swap().
Referenced by std::match_results< _Bi_iter, _Alloc >::swap().
Definition at line 1933 of file regex.h.
Definition at line 1936 of file regex.h.
Generated automatically by Doxygen for libstdc++ from the source code.
libstdc++ |