in reply to Re^2: Silly Regex question (better?)
in thread Silly Regex question

If the desire is to squash whitespace--with a definition for 'whitespace' of spaces or tabs--then tr/// might be a better choice

$string =~ tr[\t ][ ]s

BTW. I can see your logic for assuming the exclusion of \n, but I wonder about \r? If your going to exclude that, shouldn't you also exclude \f? I also wonder about \cK--does anything respond to Vertical tab any more?


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.