Lines Matching refs:rewrite
307 // Returns the maximum submatch needed for the rewrite to be done by Replace().
308 // E.g. if rewrite == "foo \\2,\\1", returns 2.
309 static int MaxSubmatch(const StringPiece& rewrite) {
311 for (const char *s = rewrite.data(), *end = s + rewrite.size();
328 const StringPiece& rewrite) {
330 int nvec = 1 + MaxSubmatch(rewrite);
337 if (!re.Rewrite(&s, rewrite, vec, nvec))
348 const StringPiece& rewrite) {
350 int nvec = 1 + MaxSubmatch(rewrite);
371 re.Rewrite(&out, rewrite, vec, nvec);
388 const StringPiece &rewrite,
391 int nvec = 1 + MaxSubmatch(rewrite);
399 return re.Rewrite(out, rewrite, vec, nvec);
825 // Append the "rewrite" string, with backslash subsitutions from "vec",
827 bool RE2::Rewrite(string *out, const StringPiece &rewrite,
829 for (const char *s = rewrite.data(), *end = s + rewrite.size();
839 << " in regexp " << rewrite.data();
848 LOG(ERROR) << "invalid rewrite pattern: " << rewrite.data();
870 // Checks that the rewrite string is well-formed with respect to this
872 bool RE2::CheckRewriteString(const StringPiece& rewrite, string* error) const {
874 for (const char *s = rewrite.data(), *end = s + rewrite.size();
881 *error = "Rewrite schema error: '\\' not allowed at end.";
889 *error = "Rewrite schema error: "
900 SStringPrintf(error, "Rewrite schema requests %d matches, "