package com.weather.Util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class passwordUtil {

    public static void main(String[] args) {

        String regx = "(?=.*[a-z])(?=.*\\d)(?=.*[#@!~%^&*])[a-z\\d#@!~%^&*]{6,16}";
        Pattern pattern = Pattern.compile(regx);
        String pwd = "aaaa@a";
        Matcher m = pattern.matcher(pwd);

        if (!m.find())
        {
            System.out.println("新增用户密码长度必须大于6并且同时包含字母数字和特殊字符");
        }else {
            System.out.println("新增用户成功");
        }


    }

}
