develooper Front page | perl.perl5.porters | Postings from May 2008

Re: [perl #53562] Zero-length regex bug

Thread Previous
From:
David Nicol
Date:
May 1, 2008 13:00
Subject:
Re: [perl #53562] Zero-length regex bug
Message ID:
934f64a20805011300u6ad214cld2d62d9102b4932a@mail.gmail.com
On Wed, Apr 30, 2008 at 6:21 PM, Tony Cook <tony@develop-help.com> wrote:
>  > But perhaps it could/should be documented more clearly... (I can't
>  > easily find it in perlre for example - or atleast not using a basic
>  > search)
>
>  From perlop:
>
>                If the PATTERN evaluates to the empty string, the last success-
>                fully matched regular expression is used instead. In this case,
>                only the "g" and "c" flags on the empty pattern is honoured -
>                the other flags are taken from the original pattern. If no
>                match has previously succeeded, this will (silently) act
>                instead as a genuine empty pattern (which will always match).
>


this comes up enough that an EMPTY PATTERN section, with an example of
how to use the feature, stuns by its absence.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About