Re: [pcre-dev] match point reset bug?

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: Craig Silverstein
CC: pcre-dev
Subject: Re: [pcre-dev] match point reset bug?
On Wed, 30 Sep 2009, Craig Silverstein wrote:

> I am, but I don't even know what \K is, so I have no idea what might
> need to be done.


You probably don't need to know. :-)

> GlobalReplace just does a pcre_match plus replace, so it's possible
> things will Just Work.


If it does a single replace, there is no issue. The problem is with
finding *all* matches in the same string. As the current code does not
mention PCRE_NOTEMPTY, I assume that it does not do the Perl-type
trickery that is needed to emulate Perl's /g behaviour. But maybe it
should be doing it? If so, the change forced by the introduction of \K
is that you should use PCRE_NOTEMPTY_ATSTART instead. There is a large
comment that explains this in detail at line 214 in the pcredemo.c
sample program.

> If not, I'll have to look at it when I'm back from vacation and have a
> free moment to breathe, which is unlikely for at least a month. :-(


Enjoy your vacation! I will be very disappointed if 8.00 is not out
within a month, but you never know...

Philip

--
Philip Hazel