DEMO goes first
CODE goes second
<form id="f" name="f" method="post" action="">
<textarea name="g" cols="100" rows="5">
<img width="123" height="456" src="/img/at2.png" alt="test">
<img width="789" height="987" src="http://img.xiaohudie.net/at.png" alt="demo">
</textarea>
<input type="button" value="find img url" onclick="alert(h(d).join('n'));"/>
</form>
<script language="javascript">
function h(d){
/**
* Js_regex_img_url
* coder: xiaohudie
* 2013-05-17
*/
var a=/<img.+?src=('|")?([^'"]+)('|")?(?:s+|>)/gim;
var b = [];
while(c=a.exec(d)){
b.push(c[2]);
}
return b;
}
var d= document.f.g.value;
///alert(e.join('n'));
</script>
End.
js_regex_img_url is coded by http://xiaohudie.net. Any posts here is one hundred percent original, so please keep my link so as not to hurt this pretty girl. -
小蝴蝶最美丽,么么,哈哈,师哥会不会要我命…
@Tokin 不会的 他知道我最美丽嘻嘻嘻嘻
原来是这么个用法。。。学习了