Here you can find the source of RemoveImgTag(String html)
public static String RemoveImgTag(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 String RemoveImgTag(String html) { Matcher m = patternImg.matcher(html); while (m.find()) { html = m.replaceAll(""); }//from w w w . ja va2 s .c o m return html; } }