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

Re: Empty regex

Thread Previous
June 18, 2008 23:05
Re: Empty regex
Message ID:
> WRT split, this is *not* an exception in split, nor is it actually a regex
> feature.  Rather, it is a feature of the match and substitute operations,
> but not split or qr.  And there's a bug here, triggered by an
> optimization:

Yes. It's a special case for split:

-- 8< --

perldoc -f split:

As a special case for "split", using the empty pattern "//" specifically
matches only the null string, and is not be confused with the regular use
of "//" to mean "the last successful pattern match".

-- >8 --


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About