java正则表达式-必须包含字母大小写,数字,特殊字符怎么写

java正则表达式-必须包含字母大小写,数字,特殊字符怎么写

一个正则判断完挺麻烦的吧
[code="java"]
String testStr = "sdf23";
System.out.println(testStr.matches(".*?[^a-zA-Z\d]+.*?")
&& testStr.matches(".*?[a-z]+.*?")
&& testStr.matches(".*?[A-Z]+.*?")
&& testStr.matches(".*?[\d]+.*?"));
[/code]

正则表达式^.$