<script> var s = "T $ # d @ e f g &"; //исходная строка var ss = s.split(/[#$@&\s]+/).join(''); alert(ss) </script>