Match Src in img tag/src\s*=\s*"(.*?)"/g This code can match all of src in text In Javascriptvar imgReg = /<img.*?(?:>|\/>)/gi; //匹配src属性 var srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i; var arr = str.match(imgReg); Please enable JavaScript to view the comments powered by Disqus.