ruby remove unsafe file characters code example Example: ruby remove unsafe file characters str.gsub(/[^0-9A-Za-z]/, '')