特殊符号验证规则
Posted smght
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了特殊符号验证规则相关的知识,希望对你有一定的参考价值。
判断字符中是否包含有特殊字符:
function containSpecial( s ) {
var containSpecial = RegExp(/[(\ )(\~)(\!)(\@)(\#)(\$)(\%)(\^)(\&)(\*)(\()(\))(\-)(\_)(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\‘)(\")(\,)(\.)(\/)(\<)(\>)(\?)(\)]+/);
return ( containSpecial.test(s) );
}
以上是关于特殊符号验证规则的主要内容,如果未能解决你的问题,请参考以下文章