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

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

Thread Previous
David Nicol
May 1, 2008 13:00
Re: [perl #53562] Zero-length regex bug
Message ID:
On Wed, Apr 30, 2008 at 6:21 PM, Tony Cook <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About