javascript正则表达式验证非法字符
<script language=javascript>
var pat=new RegExp("[^a-zA-Z0-9\_\u4e00-\u9fa5]","i");
if(pat.test(una.value)==true|| pat.test(psw.value)==true)
{ alert('输入含有非法字符!');
return false; }
else return true;
</script>
var pat=new RegExp("[^a-zA-Z0-9\_\u4e00-\u9fa5]","i");
if(pat.test(una.value)==true|| pat.test(psw.value)==true)
{ alert('输入含有非法字符!');
return false; }
else return true;
</script>