//正则表达式的matches方法检测:
String str2 = "\\dhello";
String str3 = "6hello";
System.out.println(str2.matches(str3)); //false
System.out.println(str3.matches(str2)); //true
System.out.println(str2.matches(str2)); //false
System.out.println(str3.matches(str3)); //true