- js 去掉字符串中的图片标签
var tieZiContent = $("#tieZiContent").html().replace(/<img.*?>/g ,'');
- js 用正则表达式替换字符串中的图片地址(img src)
content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
console.log(capture);
});
var tieZiContent = $("#tieZiContent").html().replace(/<img.*?>/g ,'');
content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
console.log(capture);
});