注册 登录
编程论坛 ASP技术论坛

asp判断域名为几级域名

mgmt_asp 发布于 2011-06-21 14:33, 414 次点击
程序代码:
Dim domain,url,re
url="http://www." 'url是要判断的网址..
Set re=new regExp
re.Global=True
re.Ignorecase=True
re.pattern="^((?:http:\/\/)?[^\/]*)(?:(?:\/?)|(?:\/.*))"
url=re.Replace(url,"$1")
domain=Replace(url,"http://","")
domain=Replace(domain,"www.","")
response.write url&"<br />是"&UBound(Split(domain,"."))&"级域名"
0 回复
1