MCPcopy Create free account
hub / github.com/apache/trafficserver / operator[]

Method operator[]

src/tsutil/Regex.cc:193–203  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

191
192//----------------------------------------------------------------------------
193std::string_view
194RegexMatches::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//----------------------------------------------------------------------------
206struct Regex::_Code {

Callers

nothing calls this directly

Calls 2

getFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected