电话号码:1开头,后面10位数字
static bool isPhone(String input) {
RegExp mobile = new RegExp(r"1[0-9]\d{9}$");
return mobile.hasMatch(input);
}
复制代码
登录密码:6~16位数字和字符组合
static bool isLoginPassword(String input) {
RegExp mobile = new RegExp(r"(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$");
return mobile.hasMatch(input);
}
复制代码
登录密码:6位数字验证码
static bool isValidateCaptcha(String input) {
RegExp mobile = new RegExp(r"\d{6}$");
return mobile