var reg = /<img[^>]*src[=\'\"\s]+([^\"\']*)[\"\']?[^>]*>/gi;
var str = '<p><img alt=\"\" src=\"/uploads/ckeditor/pictures/7/content_1234594100532399625.jpg\" style=\"width: 700px; height: 560px;\" />132<img alt=\"\" src=\"/uploads/ckeditor/pictures/8/content_1901904_140154707195_2.jpg\" style=\"width: 800px; height: 531px;\" /></p>\r\n';
while (reg.exec(str))
{
console.log(RegExp.$1);
}
正则获取字符串中图片路径
最新推荐文章于 2024-06-21 16:18:50 发布