62,628
社区成员
发帖
与我相关
我的任务
分享public class Test {
public static void main(String[] args) {
String str = "123<sPan style=\"color: bule\">abc</Span><span \r\n" +
"style=\"color: bule\">\r\n" +
"abc</Span>456< sPan style=\"color: \n" +
"bule\">abc< /Span >789<SPAN>kkk</SPAN>0123";
str = str.replaceAll("(?i)(?s)<\\s*?span.*?>.*?<\\s*?/span\\s*?>", "");
System.out.println(str);
}
}str.replaceAll("<SPAN>(.*?)</SPAN>","$1");[code=Java]public class replaceAlTest {
public static void main(String[] args){
String s="<SPAN> 内容 </SPAN>";
String str=s.replaceAll("<SPAN>","");
System.out.println(str.replaceAll("</SPAN>", ""));
}
}[/code]str.replaceAll("<SPAN>.*?</SPAN>","");