Re: [pcre-dev] [Bug 1325] New: New quantifier combining 'po…

Góra strony
Delete this message
Autor: Philip Hazel
Data:  
Dla: 1325
CC: pcre-dev
Temat: Re: [pcre-dev] [Bug 1325] New: New quantifier combining 'possessive' and 'lazy'
On Mon, 17 Dec 2012, Chris wrote:

> After '+' (possessive) and '?' (lazy), a union of the two: '*' (scrooge). It
> depends actually in combination with the next token, as a logical 'lazy
> possessive' makes no sense, it would result always in the least amount of
> characters.


This would be non-Perl compatible. There are precedents for PCRE having
such features, but I can't say that I am very keen on the idea,
especially as it isn't too much hassle to write the equivalent.

> Notation and meaning/alias:
> a?*b            (?>a??b)
> a**b            (?>a*?b)
> a+*b            (?>a+?b)
> a{n,m}*b        (?>a{n,m}?b)
> a{n,}*b         (?>a{n,}?b)


Another reason for being cautious is that this is a new paradigm ...
depending on the following item as it does, so that a?* on it own is not
meaningful.

Philip

--
Philip Hazel