惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Securelist
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
S
Schneier on Security
L
LangChain Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
T
Tenable Blog
B
Blog RSS Feed
V
Visual Studio Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
T
The Exploit Database - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
W
WeLiveSecurity
I
InfoQ
The Hacker News
The Hacker News
雷峰网
雷峰网
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
Hacker News: Ask HN
Hacker News: Ask HN
T
Threat Research - Cisco Blogs
GbyAI
GbyAI
The Last Watchdog
The Last Watchdog
P
Privacy International News Feed
Cyberwarzone
Cyberwarzone
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
人人都是产品经理
人人都是产品经理
V
V2EX
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Cybersecurity and Infrastructure Security Agency CISA
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Troy Hunt's Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - pboy2925

博客搬家 http://jorkin.me [导入][转]一个经典的Access数据库 [导入][转]阿D SQL注入工具常用的一些注入命令 [导入]jQuery插件推荐(最后更新2009年01月18日) [导入][原创]级联checkbox,自用权限管理模块,需jQuery [导入][转]跨越域的Cookie [导入]Select的OnChange()事件 [导入]ASP常用函数:RadioScript() [导入][转]读取汉字点阵数据 [导入]可爱的小动物们 [导入]值得收藏经典民间偏方 [导入]如何学习英语(英语学习中最重要的五点) [导入]Oracle常用函数:IDCARD15TO18() 身份证15位转18位函数 [导入][转]地产忽悠大全 [导入]scrollLeft scrollTop clientWidth clientHeight 各浏览器修正 [导入][转]js + .Net 图片切割系统 [导入]试用了一下Dreamweaver CS4 [导入]中文 Windows 95 GBK 代码集字符定义表 [导入]千万千万不要买宏图三胞的东西
[导入][原创]正则分析二级或多级域名的主域名
pboy2925 · 2009-01-10 · via 博客园 - pboy2925

对于大部分域名还算正确(小国家的域名未列出,需要添加请到 域名 - 维基百科  查询)

正则表达式为:
([a-z0-9][a-z0-9\-]*?\.(?:com|cn|net|org|gov|info|la|cc|co)(?:\.(?:cn|jp))?)$

匹配结果:

http://jorkin.reallydo.com
http://www.howq.net
http://bbs.eventsmap.com.cn
http://mp3.sogou.com
http://www.51.la
http://www.yahoo.co.jp
http://6.cn
http://hi.baidu.com

谁有不能匹配的域名请在后面回复。

另: 二级域名正则表达式分析

这样就可以实现扫描页面,在外链接后面加个小图标

$(document).ready(function() {
    var sHostname = location.hostname;
    sDomain = sHostname.replace(/(.*?)([a-z0-9][a-z0-9\\-]*?\.(?:com|cn|net|org|gov|info|la|cc|co)(?:\.(?:cn|jp))?)$/, "$2").toLowerCase();
    $('a:not(:has(img))').filter(function() {
        var sLinkHostname = this.hostname;
        sLinkDomain = sLinkHostname.replace(/(.*?)([a-z0-9][a-z0-9\\-]*?\.(?:com|cn|net|org|gov|info|la|cc|co)(?:\.(?:cn|jp))?)$/, "$2").toLowerCase();
        return sLinkDomain !== sDomain && sLinkDomain !== '';
    }).after(' <img src="/images/external.png" alt="外部链接">');
})

文章来源:http://Jorkin.Reallydo.Com/default.asp?id=567