----------------------------------------------------------------------------
| 191 | |
| 192 | //---------------------------------------------------------------------------- |
| 193 | std::string_view |
| 194 | RegexMatches::operator[](size_t index) const |
| 195 | { |
| 196 | // check if the index is valid |
| 197 | if (index >= pcre2_get_ovector_count(_MatchData::get(_match_data))) { |
| 198 | return std::string_view(); |
| 199 | } |
| 200 | |
| 201 | PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(_MatchData::get(_match_data)); |
| 202 | return std::string_view(_subject.data() + ovector[2 * index], ovector[2 * index + 1] - ovector[2 * index]); |
| 203 | } |
| 204 | |
| 205 | //---------------------------------------------------------------------------- |
| 206 | struct Regex::_Code { |