从页脚获取HREF的正则表达式 [英] Regular expression for getting HREF from footer

查看:84
本文介绍了从页脚获取HREF的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我需要在HTML代码中获取最后的HREF,这意味着要在页面的页脚中获取HREF.

I have a requirement where I need to get the last HREF in the HTML code, means getting the HREF in the footer of the page.

有相同的直接正则表达式吗?

Is there any direct regular expression for the same?

推荐答案

没有正则表达式,请使用:last 代替jQuery选择器. 演示:

No regex, use the :last jQuery selector instead. demo :

<a href="foo-link">foo</a>
<a href="bar-link">bar</a>
var link = $("a:last");

这篇关于从页脚获取HREF的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆