Re: [pcre-dev] Partial matching in PCRE

Kezdőlap
Üzenet törlése
Szerző: ND
Dátum:  
Címzett: pcre-dev
Tárgy: Re: [pcre-dev] Partial matching in PCRE
On 2009-09-05 10:26, Philip Hazel wrote:
>
> I took a look at the code, and it turned out to be surprisingly easy to
> fix this. I have committed code that yields the first inspected
> character that was used in the partial match. If your pattern is
> /(<=foo)bar/ and your string is "abcfooba" the partial match yields
> "fooba". The same with /foo\Kbar/.
>

segment1: abcfooba
segment2: d
pattern: /foobar|(<=cfoob)an|(<=abcfoob)ad/

Is there correct result produced with PCRE_PARTIAL_HARD in this situation?
What alternative works first? IMHO, the first.
If it is, than the main application must have another way to determine the length of discarded part of the current segment. May it be that a pcre_fullinfo return the maximum lookbehind size of compiled pattern?

Michael