我試圖用一個正則表達式來篩選IMG SRC,但它不工作:正則表達式表達式過濾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);
定義 「不工作」。預期的結果是什麼? –