Java Regex String Replace HTML replaceHtml(String html)

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

Description

replace Html

License

Apache License

Declaration

public static String replaceHtml(String html) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static String replaceHtml(String html) {
        String regEx = "<.+?>";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(html);
        String s = m.replaceAll("");
        return s;
    }/*  ww  w .  j  a v a  2  s .  c  o m*/
}

Related

  1. removeTag(String text)
  2. removeTags(String html)
  3. removeTags(String input, List knownTagList)
  4. removeTags(String string)
  5. replaceHtml(String html)
  6. replaceHtmlEntities(final String text)
  7. replaceHtmlEntities(String aText, boolean preserveFormatting)
  8. replaceTags(String payload, Map tags)
  9. replaceTags(String str, Map tags)