正则表达式,提取网页中的链接地址
更新时间:2006年10月07日 00:00:00 作者:
<td class=cate width="45%" style="word-break:break-all">
<a class=M href="http://jmfengcai.cn.alibaba.com/athena/companydetail/jmfengcai.html" onMouseDown="return aliclick(this,'?alishop=companylistcompanyname');" target="_blank" class=M>江门市蓬江区凤彩工艺厂</a>
<br>
代码如上.我请问如何用正则表达式,把"http://jmfengcai.cn.alibaba.com/athena/companydetail/jmfengcai.html"提取出来?
/(http:\/\/\[^" ']+)/gm
/href *= *['"]*(\S+)["']* */gm
根据不同需要选择。
<a class=M href="http://jmfengcai.cn.alibaba.com/athena/companydetail/jmfengcai.html" onMouseDown="return aliclick(this,'?alishop=companylistcompanyname');" target="_blank" class=M>江门市蓬江区凤彩工艺厂</a>
<br>
代码如上.我请问如何用正则表达式,把"http://jmfengcai.cn.alibaba.com/athena/companydetail/jmfengcai.html"提取出来?
复制代码 代码如下:
/(http:\/\/\[^" ']+)/gm
/href *= *['"]*(\S+)["']* */gm
根据不同需要选择。
相关文章
MyEclipse删除网上复制下来的来代码带有的行号(正则去除行号)
这篇文章主要介绍了MyEclipse删除网上复制下来的来代码带有的行号,利用正则表达式进行去除,感兴趣的小伙伴们可以参考一下2015-12-12判断用户输入的银行卡号是否正确的方法(基于Luhn算法的格式校验)
下面小编就为大家带来一篇判断用户输入的银行卡号是否正确的方法(基于Luhn算法的格式校验)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2017-04-04
最新评论