html转文本 | JAVA
br转换行 1 2 3 4 5 6 7 8 9 10 11 12 public class Test1 { private static final Log log = LogFactory.getLog(Test1.class); public static void main(String[] args) throws Exception { String str = "<br> <br > <br /> <br/>"; str = str.replaceAll("(?i)<br[^>]*>","\n"); System.out.println("str = " + str); } 正则表达式解析 html转txt 1 2 3 4 5 6 7 8 9 10 11……