Re: [pcre-dev] \K in lookahead assertion gives unpredictable…

Αρχική Σελίδα
Delete this message
Συντάκτης: ph10
Ημερομηνία:  
Προς: ND
Υ/ο: Pcre-dev
Αντικείμενο: Re: [pcre-dev] \K in lookahead assertion gives unpredictable result
On Tue, 24 Dec 2013, ND wrote:

> I know nothing about C debugging. I'm so sorry.
>
> My OS is Windows 7 64 bit. If you can't reproduce this bug on Linux OS, then
> may be anyone else who have Windows 7 be able to debug C programs on it...


It is clear that pcretest has a bug here. It does not recognize the case
when the "end" of the match is earlier than the "start" (as set by \K).
When I get time, I will modify pcretest as suggested by Zoltán, and also
document the fact that using \K in an assertion can produce this effect.

In Linux, it just prints the rest of the string, starting at the "start"
position - I think this is probably accidental. When the length of the
matched string is negative, it prints to the end of the string.
Presumably in your case there isn't a trailing zero...

Philip

--
Philip Hazel