Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Care to explain s/\A\s*//?

by bart (Canon)
on Sep 05, 2003 at 13:46 UTC ( [id://289303]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Care to explain s/\A\s*//?
in thread Help me write a good reg-exp for this text

I don't understand why you want to act in such an obscure manner, because without the /m modifier, as here, there is no difference between /^\s*/ and /\A\s*/. So you might just as well use the far more familiar form, with the caret.

The difference between /\Z/, /\z/ and /$/ is far more significant.

Well, I do agree with you on the RTFM part... it's all in there. Looking there should become a more natural response, than asking here.

I'd prefer

s/^\s+//;
anyway, as this wouldn't do an empty substitution if the string doesn't start with whitespace.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://289303]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.