var str = '<p><img src="../../static/bkhumor-emoji/34.gif"></p><p><br></p><p><img style="max-width: 100px;height: auto;" src="">
var substr = str.match(/<img[^>]+>/);
console.log(substr, 'substrsubstrsubstrsubstrsubstrsubstrsubstr’');
var str = '<p><img src="../../static/bkhumor-emoji/34.gif"></p><p><br></p><p><img style="max-width: 100px;height: auto;" src="">
var substr = str.match(/<img[^>]+>/);
console.log(substr, 'substrsubstrsubstrsubstrsubstrsubstrsubstr’');
本文标题:js 正则表达式 提取html标签(举例img)
本文链接:https://www.haomeiwen.com/subject/rurcqltx.html
网友评论