0
我得到了下面的字符串:只有符合特定領域
<a href="/web/20120412083942/http://test.com/contact">Contact Us</a> | <a href="/web/20120412083942/https://test.com/privacy-policy">Privacy Policy</a> <br /><br />
<a href="/web/20120412083942/http://www.cassandracastanedaphoto.com/index2.php#/home/">Photography by Cassandra Castenada</a></span><!-- Start Shareaholic TopSharingBar Automatic --><!-- End Shareaholic TopSharingBar Automatic --><script src="/web/20120412083942js_/http://www.test.com/wp-content/plugins/tweetmeme/button.js" type="text/javascript"></script>
<!-- tracker added by Ultimate Google Analytics plugin v1.6.0: /web/20120412083942/http://www.oratransplant.nl/uga -->
我想比賽:
/網絡/ 20120412083942/http://test.com
/網絡/ 20120412083942/https://test.com
/web/20120412083942js_/http://www.test.com
基本上具有網絡/ [數字]任何網址[潛在字符串]/http://test.com
這裏是我的正則表達式到目前爲止:
((http(s)?:\/\/)?web.archive.org)?\/web\/\d+.*?\/http(s)?:\/\/(www\.)?test\.com
的問題是,它匹配了整節:
/網絡/ 20120412083942/http://www.cassandracastanedaphoto.com/index2.php#/home/「>攝影 通過卡桑德拉Castenadahttp://test.com
我該如何做到這一點,所以它停止後,域名沒有開始與test.com?
使用使用RegexBuddy軟件有人不禁要問,出口是:) –
哇,這是很好的事測試!完美的作品! 謝謝:) –