public class CheckPassword { //数字 public static final String REG_NUMBER = ".*\\d+.*"; //小写字母 public static final String REG_UPPERCASE = ".*[A-Z]+.*"; //大写字母 public static final String REG_LOWERCASE = ".*[a-z]+.*"; //特殊符号 publ
js 正则 以字母开头必须有 大小写字母数字组成 可以有“@"或 ”.“ var reg = /^[a-zA-Z]{1}(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d_@\.]{6,16}$/; var v = reg.test(str); alert(v); //校验是否全由数字组成 function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)) return false return tr