/*** * 获取ImageSrc地址 * * @param listImageUrl * @return */ public static List<String> getImageSrc(String html) { List<String> listImgSrc = new ArrayList<String>(); Pattern p = Pattern.compile("<img[^>]+src\s*=\s*['"]([^'"]+)['"][^>]*>");// <img[^<>]*src=['"]([0-9A-Za-z.\/]*)['"].(.*?)>"); Matcher m = p.matcher(html); // System.out.println(m.find()); // System.out.println(m.groupCount()); while (m.find()) { listImgSrc.add(m.group(1)); // System.out.println(m.group() + "-------------↓↓↓↓↓↓"); // System.out.println(m.group(1)); } return listImgSrc; }