Here you can find the source of IsContainImg(String html)
public static boolean IsContainImg(String html)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { static final Pattern patternImg = Pattern .compile("<img(.+?)src=\"(.+?)\"(.+?)(onload=\"(.+?)\")?([^\"]+?)>"); public static boolean IsContainImg(String html) { Matcher m = patternImg.matcher(html); while (m.find()) { return true; }/*from www.j a v a 2 s . c om*/ return false; } }