//判断字符串是不是中文String.prototype.isChinese = function () { var reg = /[^\x00-\xff]/ig;//判断是否存在中文和全角字符// var reg=/[A-Za-z]*[a-z0-9_-]|\s$/;//判断是否包含数字字母下划线 当使用这个时如果只有部分是中文字符还可以使用英文字体 if (reg.test(this)) { return true;//存在中文 } return
str.isnumeric(): True if 只包含数字:otherwise False.注意:此函数只能用于unicode string str.isdigit(): True if 只包含数字:otherwise False. str.isalpha():True if 只包含字母:otherwise False. str.isalnum():True if 只包含字母或者数字:otherwise False.
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