[pcre-dev] [Bug 1368] Easier to use function for multi-segme…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1368] Easier to use function for multi-segment matching
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1368




--- Comment #3 from Philip Hazel <ph10@???> 2013-07-15 10:13:48 ---
On Sun, 14 Jul 2013, Sébastien Wilmet wrote:

> OK, so the safer way is to use pcre_exec() with PCRE_PARTIAL_HARD, with a
> larger segment if a partial match is returned, until a complete match is found,
> or there is no match.


Yes.

> However we can see in the documentation (in the "ISSUES WITH MULTI-SEGMENT
> MATCHING" section):
>
> > 4. Matching a subject string that is split into multiple segments may
> > not always produce exactly the same result as matching over one single
> > long string, especially when PCRE_PARTIAL_SOFT is used.
>
> Is it also true for pcre_exec() with PCRE_PARTIAL_HARD?


If you make correct use of the information about earliest character
inspected and where the start of the match is, you should get the
"right" result with PCRE_PARTIAL_HARD and pcre_exec(). The changes that
have happened to partial matches in different releases of PCRE are the
result of figuring out, over time, exactly what is needed to make this
work.

Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email