Autor: Philip Hazel Data: A: ND CC: Pcre-dev Assumpte: Re: [pcre-dev] Assertions with quantifier behaviour is Perl
incompatible
On Mon, 2 May 2011, ND wrote:
> Good day!
>
> Assertions with quantifier for example "\z?", "\b{0,1}", "(?=a){10}"
> works well in Perl but produces "RegEx error: nothing to repeat" in PCRE
>
> May be a PCRE correction is needed to get compatibility with Perl.
The pcrecompat document already says:
2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl
permits them, but they do not mean what you might think. For example,
(?!a){3} does not assert that the next three characters are not "a". It
just asserts that the next character is not "a" three times.
I suppose it should say "lookahead or any other kind of assertions". It
really doesn't seem sensible to put effort into supporting something as
useless as this.