Re: [pcre-dev] Return last bumpalong offset in partial_hard …

Góra strony
Delete this message
Autor: ND
Data:  
Dla: Pcre-dev
Temat: Re: [pcre-dev] Return last bumpalong offset in partial_hard matching
> you want it to return the starting point of the last match attempt. Is that right?
Yes if you don't mean that 'starting point of the last match attempt' is the offset of first character of the match.
For example if we match 'abc' against pattern 'b\Kc' then
last bumpalong offset = 1
offset of first character of the match = 2

> I presume you then expect to use that offset minus the max lookbehind to discover what characters to keep. Is that right?

You are right.

> Perhaps the bumpalong should be returned in ovector[2] rather than ovector[0]

May be. But I'm agreed with Zoltan. Now first inspected symbol is used exactly in this way: keeped length is calculated using ovector[0]-max_lookbehind.
If ovector[0] will carry a last bumpalong offset than no changes for user happens. Main program stay automatically keep needed chunk but do it a quite precisely.