Get Url From Img Tag
import java.io.IOException; import java.io.InputStream; import java.text.ParseException; import java.util.Collection; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; class Main{ public static String getUrlFromImgTag(String imgTag) { String url = null; Pattern p = Pattern.compile("src='[^']*'", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(imgTag); if (m.find()) { url = imgTag.substring(m.start() + 5, m.end() - 1); } return url; } }