电话号码: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
最后
以上就是仁爱绿茶最近收集整理的关于dart常用正则表达式的全部内容,更多相关dart常用正则表达式内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复