java正则表达式移除网页中注释代码

/**
* 移除网页中注释掉的代码
*
* @param str
* @return
*/
public static String removedisablecode(String str) {
Pattern pattern = Pattern.compile("<!--[\w\W \n]*?-->");
Matcher matcher = pattern.matcher(str);
str = matcher.replaceAll("");
return str;
}

原文地址:https://www.cnblogs.com/coderdxj/p/8329896.html