日期:2014-05-20 浏览次数:20772 次
String str="中办发〔<span lang='EN-US'>2001</span>〕<span lang='EN-US'>19</span>号"; String s=""; String regex="<[^>]+>"; Pattern pattern=Pattern.compile(regex); Matcher matcher=pattern.matcher(str); while(matcher.find()){ s=s+str.substring(0,str.indexOf(matcher.group())); str=str.substring(str.indexOf(matcher.group())+matcher.group().length()); matcher=pattern.matcher(str); } s=s+str; System.out.println(s);