1
public void saveMenuContent(String mainContent) { String content =""; String regex = "http://[\\s\\S]*?/[0-9]+"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(mainContent); while(matcher.find()) { System.out.println(matcher.group()); } }这则加一个?表示最短匹配的,不加就匹配最长匹配的