public member function
<regex>

std::match_results::max_size

size_type max_size() const;
Return maximum size
Returns the maximum number of matches a match_results object can hold.

This is the maximum potential number of elements the container can hold due to system constraints or limitations on its library implementation.

Parameters

none

Return value

The maximum number of matches (and sub-matches) the object can hold.

Member type size_type is an unsigned integral type.

Example

1
2
3
4
5
6
7
8
9
10
11
12
// match_results::max_size
#include <iostream>
#include <regex>

int main ()
{
  std::match_results<char*> mr;

  std::cout << "max_size: " << mr.max_size() << std::endl;

  return 0;
}

Possible output:
max_size: 357913941


See also