From: Adam Dickmeiss Date: Wed, 19 Jun 2013 09:26:21 +0000 (+0200) Subject: http_rewrite: Avoid ? regex'es. X-Git-Tag: v1.3.59~57^2~1 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=3965a0918cec02fe4ef202638fd714150b93a0ba;p=metaproxy-moved-to-github.git http_rewrite: Avoid ? regex'es. They don't work in Boost 1.33 (rather old). --- diff --git a/src/filter_http_rewrite.cpp b/src/filter_http_rewrite.cpp index 1581694..d21b4c8 100644 --- a/src/filter_http_rewrite.cpp +++ b/src/filter_http_rewrite.cpp @@ -256,9 +256,11 @@ void yf::HttpRewrite::Rule::parse_groups() int gnum = 0; bool esc = false; const std::string & str = regex; + std::string res; yaz_log(YLOG_LOG, "Parsing groups from '%s'", str.c_str()); for (size_t i = 0; i < str.size(); ++i) { + res += str[i]; if (!esc && str[i] == '\\') { esc = true; @@ -273,7 +275,9 @@ void yf::HttpRewrite::Rule::parse_groups() if (i+1 < str.size() && str[i+1] == ':') //non-capturing { if (gnum > 0) gnum--; + res += str[i]; i++; + res += str[i]; continue; } if (i+1 < str.size() && str[i+1] == 'P') //optional, python @@ -307,6 +311,7 @@ void yf::HttpRewrite::Rule::parse_groups() } esc = false; } + regex = res; } std::string yf::HttpRewrite::Rule::sub_vars (