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