diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/regex/regex.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index c095291aea..c728657d6b 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -603,10 +603,8 @@ struct RegExNodeGroup : public RegExNode { int res = childset[i]->test(s, pos); - if (s.complete) - return res; - if (inverse) { + s.complete = false; if (res < 0) res = pos + 1; else @@ -616,6 +614,9 @@ struct RegExNodeGroup : public RegExNode { continue; } + if (s.complete) + return res; + if (res >= 0) { if (reset_pos) res = pos; |