我在论坛上搜索了一下,找不到任何能解决我问题的东西。例如,我尝试仅从超链接检索到网站的链接。你知道吗
我有68条不同的线,像这样:
href="/creditrating/Pages/Home.aspx" class="rmLink">
<span class="rmText">Centre for Credit Rating</span></a></li>
<li class="rmItem "><a href="http://www.creative-growth.eu/" class="rmLink">
<span class="rmText">Creative Growth Project</span></a></li><li class="rmItem ">
<a href="/faculties/health-life-social-sciences/centres/Pages/Placements-Practice-Education-Centre.aspx" class="rmLink">
<span class="rmText">Placements & Practice Education Centre</span></a></li>
<li class="rmItem "><a href="/research/centresandprojects/smartcities/Pages/Smart-Cities.aspx" class="rmLink">
<span class="rmText">Smart Cities</span></a></li>
<li class="rmItem rmLast"><a href="/research/centresandprojects/src/Pages/src.aspx" class="rmLink"><span class="rmText">Scottish Resource Centre for Women in SET</span></a>
</li>
我只需要这个链接http://www.creative-growth.eu/
我想用正则表达式来做这个。你能给我解释一下密码吗?你知道吗
使用捕获
href="(http(s?):\/\/[^"]+)"
的正则表达式这将捕获链接以及它们是否引用HTTPS站点
以http://
开头 取除/
以外的任何字符 以/
相关问题 更多 >
编程相关推荐