[pcre-dev] [Bug 892] a duplicate named subpattern returns th…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 892] a duplicate named subpattern returns the first match/nomatch result for conditional match of that pattern within the expression.
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=892




--- Comment #2 from Philip Hazel <ph10@???> 2009-09-29 12:06:17 ---
This is an inevitable consequence of the way duplicate names are fudged into
PCRE, and is a related issue to #760. The problem is that the compiled code
works entirely in terms of capturing parenthesis numbers, not names. When
compiling the test for "is pattern <name> set?" it just picks the first number
that is associated with <name>. In your pattern, the compiled code contains a
test for subpattern number 1.

A deeper question is this: If there are two or more subpatterns with the same
name, what does "is pattern <name> set?" actually mean? Does it mean "any" or
"all" of the named subpatterns? I suppose "any" is the more useful.

This is unlikely to be changed soon, unless I can think of some cunning way of
handling it. I am in the last stages of preparing a new release; I can't say
whether I will have inspiration in time or not...


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email