Re: [pcre-dev] Multi segment matching using pcre_dfa_exec

Top Page
Delete this message
Author: Eldar Kleiner
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] Multi segment matching using pcre_dfa_exec
>
> But the caller can do the same, right now. When the caller gets the
> PCRE_PARTIAL return, a temporary buffer starting "123" can be
> constructed, joined onto more data from the second buffer, and the
> entire match can be retried, *not* using PCRE_DFA_RESTART.
>


True, but the caller will have to do that each time PCRE_PARTIAL is returned
rather then only when there is a chance of losing matches. That was exactly
the point I was trying to make in my previous post. In the first scenario
PCRE_PARTIAL_ALTERNATIVE could be returned (instead of PCRE_PARTIAL) to
indicate that if the caller wants to make sure that no matches are lost, the
buffers must be linearized.

In the second scenario, there is no such issue and thus PCRE_PARTIAL can be
returned and the second buffer can be scanned with PCRE_DFA_RESTART with no
worry of losing matches.

Thanks,
E.