正则验证(持续更新)

正则验证(持续更新)

    验证账号: String regex = "^[a-zA-Z0-9]{6,20}$";
    验证域名: String regex = "^[a-zA-Z]{6,20}$";
    验证邮箱:String regex = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$";
    验证手机号: String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
    

 工具验证
    JAVA: Pattern.matches(regex, text); -- 返回Boolean类型

猜你喜欢

转载自blog.csdn.net/weixin_37704921/article/details/89187856
今日推荐