--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote:
> /me greets [Ovid]
> 
> On Aug 20, Curtis Poe said:
> 
> >First, I added the caret to force matching from the beginning of the line so we 
>don't
> accidentally
> >match embedded whitespace.  That may or may not matter, depending upon the 
>structure of the
> data,
> >but since I haven't seen the rest of the thread, I'm not sure.
> 
> That can never be a problem when using the * quantifier.  Any regex of the
> form
> 
>   /(THIS)*/
> 
> will always match at the beginning of a string.

Oh, duh!  However, I suspect that new monks, uh, programmers, are going to get 
confused about that
one.  It's not exactly intuitive to many why the following doesn't print 'abc':

    my $string = "   abc   ";
    $string =~ /(abc)*/;
    print $1;

But then, perhaps that's just [Ovid] being picky :)

Cheers,
Curtis Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to