日期:2014-05-16  浏览次数:20389 次

javascript pattern只允许数字,英文字母和一些特殊字符
<script type="text/javascript">
    var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
    var chPattern = /^[A-Za-z0-9  \!\@\#\$\^\&\*\-\_\+\=\:\\\'\;\,\.\/\?\(\)\{\}\[\]\<\>]*$/;
   
    var s = "yang Hua Jie qwe231@[]";
    alert(chPattern.test(s) );
</script>
?

?