Depending on the encoding your string is in, the easiest is to use either \W (for ASCII) or [[:^alpha:]] (for Unicode?). See perlop on the s/// operator and perlre on the character escapes used.
s/\W/ /g;
Update: Fixed incorrect usage of POSIX character class, as spotted by AnomalousMonk. It's [[:alpha:]], and not [:alpha:] (this error is also mentioned in perlre, and will produce a warning, while matching :, a, l, p or h.
In reply to Re: Replacing symbols in a string
by Corion
in thread Replacing symbols in a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |