/** * 正则表达式对大写html标签进行转换成小写 * */ public static String tagNameToLowerCase(String html){ StringBuffer result = new StringBuffer(); Pattern pattern = Pattern.compile("<([^>\\s]+)"); Matcher m = pattern.matcher(html); while (m.find()) { m.appendReplacement(result,"<" + m.group(1).toLowerCase()); } m.appendTail(result); return result.toString(); }