87,994
社区成员
发帖
与我相关
我的任务
分享
var str='<h3> <img align="left" height="100" src="/Web/ckeditor_3.0.1/ckfinder/userfiles/images/ContentRes/19/100×80/2009-12-07-02205817.jpg" style="margin-right: 10px" width="100" />东京大学 </h3> <p>'
var nstr=(str.match(/<img.*?src=\"([^\"]*)\"/i) ||["",""])[1];
alert(nstr);
<script type="text/javascript">
<!--
var str = '<h3><img align="left" height="100" src="/Web/ckeditor_3.0.1/ckfinder/userfiles/images/ContentRes/19/100×80/2009-12-07-02205817.jpg" style="margin-right: 10px" width="100" />东京大学 </h3><h3><img align="left" height="100" src="/Click_Me.jpg" style="margin-right: 10px" width="100" />东京大学 </h3> ';
var reg = /src\s*=\s*(\'|\")([^\'\"]*)\1/ig, arr = [], re = [];
while((re = reg.exec(str)) != null) {
arr.push(re[2]);
}
alert(arr);
//-->
</script>