in reply to Re^3: trim leading & trailing whitespace
in thread trim leading & trailing whitespace
How about this:
$_ = " yes \n \n \n they \n \n will \n\n\n"; s/^\s*?(?:\b(.*?)\s*?)?(\n)?$/$1$2/gm; print; __END__ % perl 443391.pl yes they will
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: trim leading & trailing whitespace
by bart (Canon) on Mar 30, 2005 at 11:10 UTC |