Re: [pcre-dev] 'Hard' partial matching don't work with some …

Página superior
Eliminar este mensaje
Autor: Zoltán Herczeg
Fecha:  
A: ND
Cc: Pcre-dev
Temas nuevos: Re: [pcre-dev] several messages
Asunto: Re: [pcre-dev] 'Hard' partial matching don't work with some assertions
Hi Naden,

I am afraid you misunderstand something here. In PCRE partial matching never prevent full matches. All your tests cases work as expected (Note that (?!b) matches to any empty string). But you want a complete behaviour change for your specific use case which would break compatibility, although they have some reasons.

As this would be a compatibility breaker new feature, we should probably aim for 8.31 The best thing would be to open a bug and discuss this new behaviour. And let other people tell their opinion which usually takes time...

If I summarize what you said so far. If hard partial matching is enabled:
- \z (and perhaps \Z and $) must never match at the end of the string
- Match must not allowed at the end of the subject string

Regards,
Zoltan

ND <nadenj@???> írta:
>And here is another strange result (may be they are connected with \z >

discussion):>
>
>

PCRE version 8.21 2011-12-12>
/(?<=a)(?!b)/+>
\P\Pa>
Partial match: a>
>

Now we swap assertions:>
>

PCRE version 8.21 2011-12-12>
/(?!b)(?<=a)/+>
\P\Pa>
0:>
0+>
>

Result changes to 'match'. Expected 'partial match'. Is there such >
assertions swaping can change result?>
>
>
>

Another example:>
>

PCRE version 8.21 2011-12-12>
/(?!a)/+>
\P\Pa>
0:>
0+>
>

We want to lookahead with 'partial hard' but PCRE don't allow this. >
Instead it assumes that string is complete and returns inutile result.>
>
>

Look at that examples please.>
Thanx.>
>

-- >
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev >