On Jun 26, David Gilden said:

>Is the following regrex the correct way to remove leading or trailing
>white space from a string?

Use two passes.

>$data =~ s/^\s+)//;
>$data =~ s/\s+$)//;

Err, extra )'s in there.

  $data =~ s/^\s+//;
  $data =~ s/\s+$//;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to