写了俩小时才写出这个正则 String str = str1.replaceAll("\\s", "").replaceAll("</[a-z]+>", "") .replaceAll("<[a-z]+([a-z]+=\"([a-z]*-?[a-z]*:[0-9a-z\\u4e00-\\u9fa5]*;)*\")*>", ""); System.out.println(str);
11-16
1771
写了俩小时才写出这个正则 String str = str1.replaceAll("\\s", "").replaceAll("</[a-z]+>", "") .replaceAll("<[a-z]+([a-z]+=\"([a-z]*-?[a-z]*:[0-9a-z\\u4e00-\\u9fa5]*;)*\")*>", ""); System.out.println(str);