Android examples for java.security:Password
is Valid Password:a-z, A-Z, 0-9 and `~!@#$%^&*()_, length 6-20
import java.util.regex.Pattern; public class Main { public static boolean isValidPwd(String pwd) { String regex = "^[a-zA-Z0-9`~!@#$%^&*()_]{6,20}$"; return Pattern.matches(regex, pwd); }/*from www .j a va 2s . c om*/ }