asdasdfsfasd';str=str.replace(/]*>/gi, '【图片】');"/>

Js替换字符串中img标签

Js替换字符串中img标签
str = 'abcd<img src="images/01.webp">asdasd<img src="images/02.webp">fsfasd';str=str.replace(/<s?img[^>]*>/gi, '【图片】');

推荐阅读