RegEx将仅从'myurl.com'匹配图像src?
我越接近就是:
实时测试: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>