MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / Extract

Method Extract

extern/re2/re2/re2.cc:501–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501bool RE2::Extract(const StringPiece& text,
502 const RE2& re,
503 const StringPiece& rewrite,
504 std::string* out) {
505 StringPiece vec[kVecSize];
506 int nvec = 1 + MaxSubmatch(rewrite);
507 if (nvec > 1 + re.NumberOfCapturingGroups())
508 return false;
509 if (nvec > static_cast<int>(arraysize(vec)))
510 return false;
511 if (!re.Match(text, 0, text.size(), UNANCHORED, vec, nvec))
512 return false;
513
514 out->clear();
515 return re.Rewrite(out, rewrite, vec, nvec);
516}
517
518std::string RE2::QuoteMeta(const StringPiece& unquoted) {
519 std::string result;

Callers

nothing calls this directly

Calls 5

MatchMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
RewriteMethod · 0.45

Tested by

no test coverage detected