Sanitize a string by removing all unwanted characters and replacing them optionally