summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZher Huei Lee <lee.zh.92@gmail.com>2017-06-26 15:25:10 +0800
committerZher Huei Lee <lee.zh.92@gmail.com>2017-06-26 15:25:10 +0800
commitf01ce3276e1d5ade07107d25ddab04117ad40be8 (patch)
treef7112d1ddf6098b5e41834d71fba202efa704fd3
parent382db0898e36c0e5b92d63126c87c71389a9a00f (diff)
Fixed inverted group thrown off by quantifiers
-rw-r--r--modules/regex/regex.cpp7
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;