in reply to Re^2: removing the white spaces
in thread removing the white spaces

A noncapturing solution should speed things.
untested:
s/(?:^\s+)|(?:\s+$)//g

Replies are listed 'Best First'.
Re^4: removing the white spaces
by japhy (Canon) on Apr 13, 2006 at 14:21 UTC
    First, the (?:...)'s aren't needed. Second, that's still no good.

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart