来自javascript QQ群。
var reg = /<img(?:(?:".*?")|(?:'.*?')|(?:[^>]*?))*>/i ;
自己写的有问题 无法过滤 ">"号
<div id = "div">
<p>
<IMG alt ="" src="file///D://aa.gif" onload = "javascript:if(this.width>screen.width-333)this.width=screen.width-333" ><BR></p>
</div>
<script>
var div = document.getElementById("div");
var html = div.innerHTML;
var reg = /<img\s+.*?src\s*=\s*(["'])([^.]+?(?:\.(jpg|jpeg|png|gif)))\1[^/]*?\/?>/ig;
var result = html.match(reg);
alert(result);
</script>