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

Kezdőlap
Üzenet törlése
Szerző: Craig Silverstein
Dátum:  
Címzett: pcre-dev
CC: pcre-dev
Tárgy: Re: [pcre-dev] match point reset bug?
} 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.

OK, I had a free moment to look into this, and the comment in
pcredemo.c is pretty clear (and the following code is too). I don't
think this will be too hard to add to the C++ wrapper, though you
never know.

I'll use shari's example string to test, involving
GlobalReplace("abc\K|def\K") on "abcdefghi". But what is the exact
test to do? Also, is there another good string for testing, that does
not involve \K? Maybe something like
GlobalReplace("aa|b*", "!", "aaaaa")
?

What is the proper output in that case?

craig