develooper Front page | perl.perl6.language | Postings from May 2005

Re: split /(..)*/, 1234567890

Thread Previous | Thread Next
From:
Autrijus Tang
Date:
May 12, 2005 08:59
Subject:
Re: split /(..)*/, 1234567890
Message ID:
20050512155926.GA42071@aut.dyndns.org
On Thu, May 12, 2005 at 04:53:06PM +0200, "TSa (Thomas Sandla´┐Ż)" wrote:
> Autrijus Tang wrote:
> >    pugs> split /(..)*/, 1234567890
> >    ('', '12', '34', '56', '78', '90')
> >
> >Is this sane?
> 
> Why the empty string match at the start?

I don't know, I didn't invent that! :-)

    $ perl -le 'print join ",", split /(..)/, 123'
    ,12,3

Thanks,
/Autrijus/

Thread Previous | Thread Next


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