From 08b94e4156f1444f196667a715bb0375ec97b931 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 25 Nov 2008 06:45:28 +0000 Subject: [PATCH] Handle branches in subregexes correctly --- source/regex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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=='[') -- 2.43.0