Android HTML Element Search IsContainImg(String html)

Here you can find the source of IsContainImg(String html)

Description

Is Contain Img

Declaration

public static boolean IsContainImg(String html) 

Method Source Code

//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;
    }
}