[Wellington-pm] Stripping spaces.

Peter Love Peter.Love at netkno.com
Mon Oct 11 15:31:37 CDT 2004


Hi,

Unfortunately I couldn't make it last night - I've got some sort of flu 
thing.

Given I wasn't there, I hope this isn't out of context.

>     s/^\s+//g; s/\s+$//g;

Why have the g modifier on these?  As they are anchored, surely there is 
only one occurence?

How would the following compare with the other two?
     s/^\s*(.*?)\s*$/$1/

Peter




More information about the Wellington-pm mailing list