正则表达式的写法,求救!!!!!!

正则表达式表示:包括大写字母、小写字母、数字、符号至少2种,密码长度8-32位。
这个怎么写呢?求救!

http://www.cnblogs.com/cdinc/p/5793142.html

w3c讲的很详细,可以看看

public void matchString(String str){
if(str.length()>=8&&str.length()<=32){
int findCount=0;
String findLolCase = "[a-z]";
String findUpCase = "[A-Z]";
String findNumber= "[0-9]";
String findOther = "[^0-9a-zA-Z]";
if(Pattern.compile(findLolCase).matcher(str).find()){
findCount++;
}
if(Pattern.compile(findUpCase).matcher(str).find()){
findCount++;
}
if(Pattern.compile(findNumber).matcher(str).find()){
findCount++;
}
if(Pattern.compile(findOther).matcher(str).find()){
findCount++;
}
if(findCount>=2){
System.out.println("输入合法");
}else{
System.out.println("输入的字符种类不合法");
}
}else{
System.out.println("输入的字符创长度不合法");
}
}
//分开匹配,匹配上了findCount就加1,它等于几就是满足了几种方式。若长度不满足则没必要匹配。
这是java匹配。要是js匹配的话就直接百度就ok了。