Write code to remove Html Tag using regex
//package com.book2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] argv) { String html = "<b>ook2s.com"; System.out.println(removeHtmlTag(html)); }/* ww w . j a v a 2s . c om*/ public static String removeHtmlTag(String html) { String regEx_html = "<[^>]+>"; Pattern p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE); Matcher m_html = p_html.matcher(html); html = m_html.replaceAll(""); return html.trim(); } }