var data = [];
var str = [];
this.content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
   data.push(capture);
   str.push(match);
});
console.log(data);
console.log(str);

js使用正则表达式匹配富文本框中的img标签

 

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 去掉富文本框中的html标签

function delHtmlTag(str){
  return str.replace(/<[^>]+>/g,"");//去掉所有的html标记
}

 

相关文章:

  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-12-24
  • 2021-08-17
猜你喜欢
  • 2021-10-19
  • 2021-09-18
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
相关资源
相似解决方案