| 499 | } |
| 500 | |
| 501 | bool 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 | |
| 518 | std::string RE2::QuoteMeta(const StringPiece& unquoted) { |
| 519 | std::string result; |
nothing calls this directly
no test coverage detected