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

Top Page
Delete this message
Author: ph10
Date:  
To: Zoltán Herczeg
CC: pcre-dev
Subject: Re: [pcre-dev] Return last bumpalong offset in partial_hard matching
On Sun, 17 Feb 2013, Zoltán Herczeg wrote:

> Ok, so this is basically for visualizing the result. I didn't think about that. But seems viable. An editor can highlight the possible result for example. Thanks for the explanation. By the way, what is the second value in the ovector?


The second value is the offset of the end of the string so that the pair
of values defines the substring that has partially matched. This is just
a convenience thing, of course, but it sort of fits in with the idea
that ovector is used in pairs.

I am not sure whether, having put the bumpalong in ovector[2], anything
should be put in ovector[3]. Perhaps also the end of string offset, for
consistency.

Another general point: adding the bumpalong then means the caller now
has all the information about the partial match, namely, where the match
was started, and the earliest character that was consulted, though of
course you cannot tell whether the longest lookbehind in the pattern was
actually activated.

Philip

--
Philip Hazel