Re: [pcre-dev] Partial matching in PCRE

Página Principal
Apagar esta mensagem
Autor: Philip Hazel
Data:  
Para: pcre-dev
CC: ND
Assunto: Re: [pcre-dev] Partial matching in PCRE
On Thu, 3 Sep 2009, Philip Hazel wrote:

> On Wed, 2 Sep 2009, ND wrote:
>
> > IMHO, for multisegment matching purposes the last bumpalong offset is
> > needed.
>
> Good point. I will do something ...


When I looked at the code, I found that it *is* the bumpalong offset
that is already being returned.

  PCRE version 8.00-RC1 2009-04-23
  /abc\K123/
      xyzabc123pqr
   0: 123
      xyzabc12\P
  Partial match: abc12


I had forgotten about \K when I was doing this, and I assumed that the
bumpalong offset would always be the same as the start of match offset.

The new documentation is therefore wrong. I will update it to point out
what happens if \K is used.

Question: Do you need both the bumpalong offset and the partial match? I
can't think of any reason why you would.

Philip

--
Philip Hazel