Front page | perl.perl5.porters |
Postings from October 2003
From: Jeff 'japhy' Pinyan
October 29, 2003 13:25
Message ID: Pine.LNX.email@example.com
On Oct 29, Mark Jason Dominus said:
>> On Oct 29, Jeff 'japhy' Pinyan said:
>> And somewhat related, why doesn't
>> "abc" =~ /(b?|[ac])*/;
>> match 'abc'? It matches '' (the zero b's at the beginning of the string).
>Why should it match 'abc'? The first alternative alternative b? is
>taken before the seoncd alternative [ac]* .
>The * operator has special code in it to prevent it from going into an
>infinite loop when its argument has matched an empty string, so the *
>loop is exited after the first pass.
Hrm. I guess I was confusing that with /\w??/g.
Jeff "japhy" Pinyan firstname.lastname@example.org http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]