package com.secspace.lib.common.utils;

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

/**
 * Created by SKR-CYW on 2016/12/20.
 */

public class RegexUtil {
    public static boolean confirmPwd(String pwd) {
        String regex = "([A-Z]+[a-z]+[0-9]+[\\d\\w]*)|([A-Z]+[0-9]+[a-z]+[\\d\\w]*)|([0-9]+[a-z]+[A-Z]+[\\d\\w]*)" +
                "|([0-9]+[A-Z]+[a-z]+[\\d\\w]*)|([a-z]+[0-9]+[A-Z]+[\\d\\w]*)|([a-z]+[A-Z]+[0-9]+[\\d\\w]*)";
        Pattern p = Pattern.compile(regex);
        Matcher matcher = p.matcher(pwd);
        if (matcher.find()) {
            if (pwd.equals(matcher.group())) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
}
