Auteur: Philip Hazel Date: À: ND CC: Pcre-dev Sujet: Re: [pcre-dev] Problem with (?| group
On Fri, 9 Oct 2009, ND wrote:
> subject: boy
> pattern: (?|(a)|b(?&tt))(?(DEFINE)(?<tt>.))
> Result: no match
>
> Why there is no match? I waits result: 'bo'
> I think there is a bug.
Which version of PCRE are you using? This works in 7.9 and the
forthcoming 8.00:
PCRE version 7.9 2009-04-11
re> /(?|(a)|b(?&tt))(?(DEFINE)(?<tt>.))/
data> boy 0: bo
1: <unset>
2: <unset> data>
PCRE version 8.00-RC1 2009-10-05
re> /(?|(a)|b(?&tt))(?(DEFINE)(?<tt>.))/
data> boy 0: bo data>
This is compatible with Perl 5.10:
Perl 5.010001 Regular Expressions
re> /(?|(a)|b(?&tt))(?(DEFINE)(?<tt>.))/
data> boy 0: bo
data>