Fix bug on regexp matched results

This commit is contained in:
Felipe Zimmerle 2015-10-19 23:05:05 -03:00
parent 3fff343009
commit e7803ebd0f

View File

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