Re: [pcre-dev] minimum matching length

Inizio della pagina
Delete this message
Autore: Philip Hazel
Data:  
To: Jack Bates
CC: pcre-dev
Oggetto: Re: [pcre-dev] minimum matching length
On Sun, 16 Nov 2008, Jack Bates wrote:

> Is is possible, using PCRE, to determine the minimum matching length of
> an expression? For example:
>
> * ^HTTP.* => 4
> * ^(?:HTTP)?.+ => 1
> * ^(?:HTTP)?.* => 0


Not using the current API. Inside the code, there is a function that
finds out whether or not a pattern can match an empty string (i.e test
for 0 or not-0). Something similar could be written to find the minimum
length. I have noted the idea.

Philip

--
Philip Hazel