We have a mix of PCRE and plugin issues here.

Sheri wrote:
> As before, this is what I get with the previous build and "any"
> 
> Hello\rHello\nGoodbye\rHelloHello\nHello\rHello\n

OK, I get that with the right combination of files.
This is not the expected result but \r\n is treated consistently.

> This is what I get with the new build
> 
> Hello\r\nGoodbye\rHelloHello\nHello\r\n

This is the kind of inconsistencies you'll get by using 1.5.2 with a
PCRE builds other than CRLF and this is why I'm not thrilled with the
change I've made. It's not too late to go back to 1.5.1 so anyone who
doesn't like what 1.5.2 does should speak up.

By comparison, look at the consistency we get with the CRLF build:

        Hello\r\nGoodbye\r\nHelloHello\r\n

The difference is that the \r after Goodbye is no longer interpreted by
PCRE as a newline. I don't know if this is a bug or not... should "any"
be greedy or not?

Now about the plugin issue...

> expected result is
> 
> Hello\r\nGoodbye\r\nHello\r\n

Is it really? This is indeed the intuitive result but look at what's
happening:

-we have a match at the first empty lines and the following two
characters are consumed to prevent an infinte loop.

-we have a zero-character match at the second empty line but this time
the following two characters are not consumed because we are in no
danger of falling in an infinite loop as characters have already been
consumed before the match (I could change that... what do other regex
implementations do?)

-we have a match at the second empty line... as it happens, the match
happens at the same position as the previous one but this time the
following two characters are deleted to prevent an infinite loop

-the last empty line doesn't match because the plugin doesn't even try
as the string has now been fully consumed (is that yet another bug?)

I hope I got it right... I don't want to debug the process step by step
right now.

Reply via email to