From: Mikko Rasa Date: Tue, 25 Nov 2008 06:45:28 +0000 (+0000) Subject: Handle branches in subregexes correctly X-Git-Tag: strings-1.1~10 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=08b94e4156f1444f196667a715bb0375ec97b931;p=libs%2Fcore.git Handle branches in subregexes correctly --- diff --git a/source/regex.cpp b/source/regex.cpp index c2590f2..4dc1b83 100644 --- a/source/regex.cpp +++ b/source/regex.cpp @@ -116,11 +116,11 @@ Regex::Code Regex::compile(const string &expr, string::const_iterator &iter, uns } --level; } - else if(*end=='|') + else if(*end=='|' && level==0) { if(branch) break; - else if(level==0) + else has_branches=true; } else if(*end=='[')