]> git.tdb.fi Git - libs/core.git/blobdiff - source/regex.cpp
Handle branches in subregexes correctly
[libs/core.git] / source / regex.cpp
index c2590f2c8f8d9109606d06499da24b6b51c87e80..4dc1b830be562d7822498e5637057abf7c53b6c9 100644 (file)
@@ -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=='[')