美文网首页
使用正则表达式去除html富文本中的style样式

使用正则表达式去除html富文本中的style样式

作者: laogui_ | 来源:发表于2019-11-02 17:37 被阅读0次

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