[re.results.size]

# 28 Text processing library [[text]](./#text)

## 28.6 Regular expressions library [[re]](re#results.size)

### 28.6.9 Class template match_results [[re.results]](re.results#size)

#### 28.6.9.4 Size [re.results.size]

[ð](#lib:match_results,size)

`size_type size() const;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11368)

*Returns*: One plus the number of marked sub-expressions in the
regular expression that was matched if *this represents the
result of a successful match[.](#1.sentence-1)

Otherwise returns 0[.](#1.sentence-2)

[*Note [1](#note-1)*:

The state of a match_results object can be modified
only by passing that object to regex_match or regex_search[.](#1.sentence-3)

Subclauses [[re.alg.match]](re.alg.match "28.6.10.2 regex_­match") and [[re.alg.search]](re.alg.search "28.6.10.3 regex_­search") specify the
effects of those algorithms on their match_results arguments[.](#1.sentence-4)

â *end note*]

[ð](#lib:match_results,max_size)

`size_type max_size() const;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11387)

*Returns*: The maximum number of sub_match elements that can be
stored in *this[.](#2.sentence-1)

[ð](#lib:match_results,empty)

`bool empty() const;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11399)

*Returns*: size() == 0[.](#3.sentence-1)
