private List<String> filterSpecialStr(String regex, String data) {
ArrayList<String> url = new ArrayList<>();
//编译正则字符串
Pattern p = Pattern.compile(regex);
//利用正则去匹配
Matcher matcher = p.matcher(data);
//如果找到了我们正则里要的东西
while (matcher.find()) {
//保存,"\r\n"表示找到一个放一行,就是换行
url.add(matcher.group());
}
return url;
}
11-17
4万+
