字符串与正则表达式匹配
public class Main { private String jaText = "this is a test "; private String enText = "The fat cat sat on the mat with a brown rat."; private String enRegEx = "^The \\w+ cat.*";//n o w j a v a . c o m - 时 代 Java private String jaRegEx = ".*.*"; private String jaRegExEscaped = ".*\u6587\u5B57.*"; public Main() { boolean found = false; found = enText.matches(enRegEx); if (found) { System.out.printf("Matches %s.\n", enRegEx); } found = jaText.matches(jaRegEx); if (found) { System.out.printf("Matches %s.\n", jaRegEx); } found = ja