Re: [pcre-dev] Inner (*MARK) don't keep its value outside th…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: ND
CC: Pcre-dev
Subject: Re: [pcre-dev] Inner (*MARK) don't keep its value outside the assertion
On Sat, 31 Dec 2011, ND wrote:

> >But it is a strange logic (in my point of view) that
> >/(?=(*:x))(q|)/K
> >keeps the MARK:x value
> >while the
> >/(?=(*:x))((*:y)q|)/K
> >don't.
> >Isn't it?
> >
>
> Perl documentation says:
>
> "When a match is successful, the $REGMARK variable will be set to the name of
> the most recently executed (*MARK:NAME) that was involved in the match."
>
> It seems that Perl don't follow the documented behaviour and returns erroneous
> results in example above.
> So I propose to not move this bug into PCRE.


I believe I have fixed this bug with a patch I have just committed. It
applies to capturing, non-capturing, and atomic parentheses. However,
the handling of MARKs is complicated; I hope I have caught all the
cases. The patch did not cause any changes in the existing tests.

Philip

--
Philip Hazel