regex只选择http://www部分hyperlin的

2024-10-03 00:24:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我在论坛上搜索了一下,找不到任何能解决我问题的东西。例如,我尝试仅从超链接检索到网站的链接。你知道吗

我有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 &amp; 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/

我想用正则表达式来做这个。你能给我解释一下密码吗?你知道吗


Tags: httpfor链接wwwlipagesclasshref