develooper Front page | perl.perl5.porters | Postings from March 2013

Re: Is this a /^*/ bug?

Thread Previous
From:
Zefram
Date:
March 25, 2013 16:00
Subject:
Re: Is this a /^*/ bug?
Message ID:
20130325155948.GH18166@lake.fysh.org
Tom Christiansen wrote:
>I realize this is nonsense, but I wonder if it is not a bug.  Shouldn't the
>overall pattern still fail, not succeed?

No, the behaviour looks correct to me.  /^*/ will match beginning-of-line
zero or more times.  In your example, the pattern matches completely
when this repetition count is zero: it's not matching beginning-of-line,
but you didn't require it to.

-zefram

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