String content="<div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\">巴斯大学(University of Bath)<span style=\\\"position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; cursor: default; padding-right: 2px; padding-left: 2px;\\\">[1]</span><a class=\\\"sup-anchor\\\" name=\\\"ref_[1]_16367\\\" style=\\\"position: relative; top: -50px;\\\"> </a> 是一所以科研为向导的英国顶尖名校,科研实力被评定为世界领先<span style=\\\"position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; cursor: default; padding-right: 2px; padding-left: 2px;\\\">[2]</span><a class=\\\"sup-anchor\\\" name=\\\"ref_[2]_16367\\\" style=\\\"position: relative; top: -50px;\\\"> </a> 。</div><div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\">巴斯大学是全英前10的著名学府,历年最高排名全英第4(分别于2003年和2015年)<span style=\\\"position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; cursor: default; padding-right: 2px; padding-left: 2px;\\\">[3]</span><a class=\\\"sup-anchor\\\" name=\\\"ref_[3]_16367\\\" style=\\\"position: relative; top: -50px;\\\"> </a> 。成立于1966年,现任校监为女王<a target=\\\"_blank\\\" href=\\\"http://baike.baidu.com/view/47650.htm\\\">伊丽莎白二世</a>的三子 - <a target=\\\"_blank\\\" href=\\\"http://baike.baidu.com/subview/3035700/11062139.htm\\\" data-lemmaid=\\\"8488157\\\">爱德华王子</a>, 威塞克斯伯爵<span style=\\\"position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; cursor: default; padding-right: 2px; padding-left: 2px;\\\">[4]</span><a class=\\\"sup-anchor\\\" name=\\\"ref_[4]_16367\\\" style=\\\"position: relative; top: -50px;\\\"> </a> 。</div><div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\"><img src=\\\"http://g5bk.com:8080/MojieProject/file/smallContentFile/418ef337-8b48-4a2d-bf59-91f0a33259c3_47802525_5(1).jpg\\\" w=\\\"2599\\\" h=\\\"1640\\\" style=\\\"width: 778px;\\\"/><br></div><div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\">大学位于<a target=\\\"_blank\\\" href=\\\"http://baike.baidu.com/view/58688.htm\\\">英格兰</a>南部的世界遗产城市-<a target=\\\"_blank\\\" href=\\\"http://baike.baidu.com/subview/89823/12443073.htm\\\" data-lemmaid=\\\"1620585\\\">巴斯</a>。根据英国各媒体近十年公布的英国大学排行榜,巴斯大学被稳固的确立为<span style=\\\"position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; cursor: default; padding-right: 2px; padding-left: 2px;\\\">[3]</span><a class=\\\"sup-anchor\\\" name=\\\"ref_[3]_16367\\\" style=\\\"position: relative; top: -50px;\\\"> </a> 英国排行前十的大学。</div><div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\"><a target=\\\"_blank\\\" href=\\\"http://baike.baidu.com/view/2416950.htm\\\">巴斯大学管理学院</a>被公认为英国最好的商学院之一, 在业界有极高的声誉,每年有大量本科毕业生进入伦敦顶级投行工作,在2016年完全大学指南排名中位居第1位。</div><div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\"><img src=\\\"http://g5bk.com:8080/MojieProject/file/smallContentFile/418ef337-8b48-4a2d-bf59-91f0a33259c3_slide1-large(1).jpg\\\" w=\\\"640\\\" h=\\\"480\\\" style=\\\"width: 640px;\\\"/><br></div><div class=\\\"para\\\" label-module=\\\"para\\\" style=\\\"word-wrap: break-word; margin-bottom: 5px; zoom: 1;\\\">巴斯大学在2015完全大学指南英国大学排名上��居第8位<span style=\\\"position: relat\n";
/**
* 定义script的正则表达式
*/
private static final String REGEX_SCRIPT = "<script[^>]*?>[\\s\\S]*?<\\/script>";
/**
* 定义style的正则表达式
*/
private static final String REGEX_STYLE = "<style[^>]*?>[\\s\\S]*?<\\/style>";
/**
* 定义HTML标签的正则表达式
*/
private static final String REGEX_HTML = "<[^>]+>";
/**
* 定义空格回车换行符
*/
private static final String REGEX_SPACE = "\\s*|\t|\r|\n";
public static String delHTMLTag(String htmlStr) {
// 过滤script标签
Pattern p_script = Pattern.compile(REGEX_SCRIPT, Pattern.CASE_INSENSITIVE);
Matcher m_script = p_script.matcher(htmlStr);
htmlStr = m_script.replaceAll("");
// 过滤style标签
Pattern p_style = Pattern.compile(REGEX_STYLE, Pattern.CASE_INSENSITIVE);
Matcher m_style = p_style.matcher(htmlStr);
htmlStr = m_style.replaceAll("");
// 过滤html标签
Pattern p_html = Pattern.compile(REGEX_HTML, Pattern.CASE_INSENSITIVE);
Matcher m_html = p_html.matcher(htmlStr);
htmlStr = m_html.replaceAll("");
// 过滤空格回车标签
Pattern p_space = Pattern.compile(REGEX_SPACE, Pattern.CASE_INSENSITIVE);
Matcher m_space = p_space.matcher(htmlStr);
htmlStr = m_space.replaceAll("");
Pattern a_space = Pattern.compile(" ", Pattern.CASE_INSENSITIVE);
Matcher b_space = a_space.matcher(htmlStr);
htmlStr = b_space.replaceAll("");
return htmlStr.trim(); // 返回文本字符串
}