perl.beginners
[Top] [All Lists]

Re: a match question

Subject: Re: a match question
From:
Date: Wed, 25 Nov 2009 14:39:08 +0800
Newsgroups: perl.beginners

On Wed, Nov 25, 2009 at 11:06 AM, John W. Krahn <jwkrahn@xxxxxxx> wrote:

>
> $ perl -le '$_="aXXXb"; print "one word is $1 at $-[0] to $+[0]" while
> /(X*)/g;'
> one word is  at 0 to 0
> one word is XXX at 1 to 4
> one word is  at 4 to 4
> one word is  at 5 to 5
>

Thanks that's so smart~

But I'm still confused since 4 is the end, why still run for the last
step of 5 to 5?

//Fairy

<Prev in Thread] Current Thread [Next in Thread>