Reputation: 7516
From https://en.cppreference.com/w/cpp/regex/match_results/str:
if
n >= size()
, a string representing the unmatched match is returned.
What is this unmatched match?
Upvotes: 3
Views: 98
Reputation: 218238
The call is equivalent to
string_type((*this)[n]);
and operator[] gives more info:
if
n >= size()
, returns a reference to astd::sub_match
representing an unmatched sub-expression (an empty subrange of the target sequence).
Upvotes: 1