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