正则表达式

正则表达式实现去掉数据中中指定的内容:

实现去掉文本数据中: img_width=="640" img_height="360" 的全部内容

String replace = contentresults.replaceAll("img_width=\"\\d+\"", " ");
String replace2 = replace.replaceAll("img_height=\"\\d+\"", " ");

 

posted @ 2015-10-09 14:12  zhanggl  阅读(105)  评论(0编辑  收藏  举报