抠出http://127.0.0.1/forum/{name}/index.html 中的变量
public static void main(String[] args) {
String str = "http://127.0.0.1/forum/zhengweilin/index.html";Pattern pattern = Pattern.compile("http://127.0.0.1/forum/(.+)/index.html");
Matcher matcher = pattern.matcher(str);
while(matcher.find()){
System.out.println(matcher.group(1));
}
}
欢迎加入我的技术交流群425783133