remove Video Tag using regex - Android java.util.regex

Android examples for java.util.regex:HTML Pattern

Description

remove Video Tag using regex

Demo Code


//package com.java2s;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    static final Pattern patternVideo = Pattern
            .compile("<object(.+?)>(.*?)<param name=\"src\" value=\"(.+?)\"(.+?)>(.+?)</object>");

    public static String removeVideoTag(String html) {
        Matcher m = patternVideo.matcher(html);
        while (m.find()) {
            html = m.replaceAll("");
        }//from  w w w.ja v a2  s .co m
        return html;
    }
}

Related Tutorials