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; }