java 正则表达式匹配字符串
private static List<String> getImage(String str){ List<String> tmp=new ArrayList<String>(); String regex="<img src=\"([^\"]+?)\" />"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(str); System.out.println(str); while(matcher.find()){ tmp.add(matcher.group(1).toString()); } return tmp; }