Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(str);
while (matcher.find()) {
String u = matcher.group(1);
}
Pattern pattern2 = Pattern.compile(regex, Pattern.DOTALL)//点(.)匹配所有(包括换行)
Matcher matches2 = pattern.matcher(content);
//也可使用以下方式
Pattern pattern3 = Pattern.compile("(?s)" + regex)//点(.)匹配所有(包括换行)
Matcher matches3 = pattern.matcher(content);