我尝试使用正则表达式来过滤 img src,但它不起作用:
var patt= src\s*=\s*"(.+?)";
var result=patt.exec('<a href="http://www.google.de/imgres" ><img id="image" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQTEhUUEhQUFRQVFRQVFRQVFBQVFxQUFRUXFhQUFBUYHCggGBolHBQUITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OFBAQGiwkHyQsLCwsLCwtLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLP" /></a>')
console.log(result);