var body = '<img src="file:///storage/emulated/0/DCIM/Screenshots/Screenshot_hahaha.png" alt=""><img src="file:///storage/emulated/0/DCIM/Screenshots/Screenshot_lalala.png" alt="">'
var sources = []
var imgReg = /<img src=\"(.*?)\"/g
var match
while((match = imgReg.exec(body))){
sources.push(match[1])
}
console.log(sources)
正则表达式来实现,当然我使用
php
语言实现把楼上代码转换成js