1、匹配任意串
(.*?)
示例:将img元素替换成pppp
String str = "<img aaa>000<img bbb>";
System.out.println(str.replaceAll("<img (.*?)>", "pppp"));
运行结果:pppp000pppp
1、匹配任意串
(.*?)
示例:将img元素替换成pppp
String str = "<img aaa>000<img bbb>";
System.out.println(str.replaceAll("<img (.*?)>", "pppp"));