-1
'myurl.com'의 이미지 src와 일치하는 RegEx는 무엇입니까?다양한 URL 중에서 특정 URL 만 찾을 수있는 정규식
라이브 테스트 : http://regex101.com/r/bR0lH2/1
정규식 :
<img.+?src=[\"'](.+?)[\"'].*?>
코드 샘플 : 당신은 거의 바로 그것을 가지고
<html>
...
<br>
</b><br>
<a href="http://example.com/a/53e39f6582954.html" target="_blank"><img src="http://myurl.com/a/b/c/53e39f658291a.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f660a74d.html" target="_blank"><img src="http://myurl.com/a/b/c/53e39f660a716.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f66a1cdd.html" target="_blank"><img src="http://others.net/a/b/c/53e39f66a1ca6.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f67265ee.html" target="_blank"><img src="http://others.com/a/b/c/53e39f67265b3.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f67ad28f.html" target="_blank"><img src="http://myurl.com/a/b/c/53e39f67ad255.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f6838b67.html" target="_blank"><img src="http://myurl.com/a/b/c/53e39f6838b2b.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f68c564f.html" target="_blank"><img src="http://others.com/a/b/c/53e39f68c5618.jpg" alt="" border="0"></a>
<a href="http://example.com/a/53e39f69630bc.html" target="_blank"><img src="http://myurl.com/a/b/c/53e39f6963085.jpg" alt="" border="0"> ... ...
...
</html>
어떤 언어를 사용하고 있습니까? 자바 스크립트? – celeritas
예. 자바 스크립트! – Azevedo