|
|
| version 1.1.1.1, 2012/02/21 23:05:51 | version 1.1.1.3, 2013/07/22 08:25:56 |
|---|---|
| Line 384 int RE::GlobalReplace(const StringPiece& rewrite, | Line 384 int RE::GlobalReplace(const StringPiece& rewrite, |
| int vec[kVecSize]; | int vec[kVecSize]; |
| string out; | string out; |
| int start = 0; | int start = 0; |
| int lastend = -1; | |
| bool last_match_was_empty_string = false; | bool last_match_was_empty_string = false; |
| while (start <= static_cast<int>(str->length())) { | while (start <= static_cast<int>(str->length())) { |
| Line 440 int RE::GlobalReplace(const StringPiece& rewrite, | Line 439 int RE::GlobalReplace(const StringPiece& rewrite, |
| out.append(*str, start, matchstart - start); | out.append(*str, start, matchstart - start); |
| Rewrite(&out, rewrite, *str, vec, matches); | Rewrite(&out, rewrite, *str, vec, matches); |
| start = matchend; | start = matchend; |
| lastend = matchend; | |
| count++; | count++; |
| last_match_was_empty_string = (matchstart == matchend); | last_match_was_empty_string = (matchstart == matchend); |
| } | } |
| Line 523 int RE::TryMatch(const StringPiece& text, | Line 521 int RE::TryMatch(const StringPiece& text, |
| extra.match_limit_recursion = options_.match_limit_recursion(); | extra.match_limit_recursion = options_.match_limit_recursion(); |
| } | } |
| int options = 0; | // int options = 0; |
| // Changed by PH as a result of bugzilla #1288 | |
| int options = (options_.all_options() & PCRE_NO_UTF8_CHECK); | |
| if (anchor != UNANCHORED) | if (anchor != UNANCHORED) |
| options |= PCRE_ANCHORED; | options |= PCRE_ANCHORED; |
| if (!empty_ok) | if (!empty_ok) |