Here you can find the source of removeTags(String html)
public static final String removeTags(String html)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static Pattern _patternTag = Pattern.compile("\\s*<[^>]*?>\\s*"); public static final String removeTags(String html) { // replace all tags with spaces Matcher m = _patternTag.matcher(html); String text = m.replaceAll(" "); return text; }/* w w w . j av a 2 s . c om*/ }