From e7803ebd0f5862615016b2ccd6185352d5ebd984 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 19 Oct 2015 23:05:05 -0300 Subject: [PATCH] Fix bug on regexp matched results --- src/utils/regex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/regex.cc b/src/utils/regex.cc index 1bc1987f..7cf660e8 100644 --- a/src/utils/regex.cc +++ b/src/utils/regex.cc @@ -52,7 +52,7 @@ int regex_search(const std::string& s, SMatch *match, s.size(), 0, 0, ovector, OVECCOUNT) > 0; if (ret > 0) { - match->match = std::string(s, ovector[2], ovector[3] - ovector[2]); + match->match = std::string(s, ovector[ret-1], ovector[ret] - ovector[ret-1]); match->size_ = ret; }