1,去除style样式的正则表达式:
String regEx = "style=\"(.*?)\""
2,使用正则表达式去除指定标签的style属性
var match = match.replace(/style=\"(.*)\"/gi,'class="img-responsive"'); //style 属性替换成 class="img-responsive"
1,去除style样式的正则表达式:
String regEx = "style=\"(.*?)\""
2,使用正则表达式去除指定标签的style属性
var match = match.replace(/style=\"(.*)\"/gi,'class="img-responsive"'); //style 属性替换成 class="img-responsive"
本文标题:使用正则表达式去除html富文本中的style样式
本文链接:https://www.haomeiwen.com/subject/enkhbctx.html
网友评论