Here you can find the source of passwordValidation(String password)
public static boolean passwordValidation(String password)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean passwordValidation(String password) { String regex = "\\w{6,19}"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(password); return m.matches(); }/*from w ww. java 2 s . co m*/ }