Here you can find the source of checkpasswd(String passwd)
public static boolean checkpasswd(String passwd)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean checkpasswd(String passwd) { Pattern p = Pattern.compile("^.{6}$"); Matcher matcher = p.matcher(passwd); if (matcher.matches()) { return true; }//from w w w .j av a 2 s . c o m return false; } }