in reply to How do I remove non-word chars but leave spaces intact?

You could use: tr/ \n\r\t\fa-zA-Z0-9_//cd Not locale-friendly, though. For that, use: s/[^\w\s]+//g