ASP正则表达式解析出网址中的域名部分函数
2008-04-06 23:15
375 查看
<%
Function getDomain(domain)
Dim re,ReturnStr,Matches
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern = "(/w+/.(com.cn|net.cn|com|cn|net|org))"
Set Matches = re.Execute(domain)
ReturnStr = ""
For Each Match in Matches
ReturnStr = Match.Value
Exit for
Next
getDomain = ReturnStr
Set re=Nothing
End Function
response.write getDomain("http://www.QQView.com/abc.htmlhttp://www.bak.baidu.com.cn/abc.html")
%>
Function getDomain(domain)
Dim re,ReturnStr,Matches
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern = "(/w+/.(com.cn|net.cn|com|cn|net|org))"
Set Matches = re.Execute(domain)
ReturnStr = ""
For Each Match in Matches
ReturnStr = Match.Value
Exit for
Next
getDomain = ReturnStr
Set re=Nothing
End Function
response.write getDomain("http://www.QQView.com/abc.htmlhttp://www.bak.baidu.com.cn/abc.html")
%>
相关文章推荐
- JS正则表达式解析出网址中的域名部分
- ASP正则表达式解析出网址中的域名部分
- ASP正则表达式解析出网址中的域名部分
- Path模块部分常用函数解析——NodeJS
- Deque的部分成员函数 解析,关于这个类,百度有很多解析,唯独没有其函数介绍
- FFmpeg部分函数解析
- x264部分函数解析
- 部分域名无法正常弹出portal问题解析
- (基于Java)编写编译器和解释器-第11章:解析程序、过程和函数-第一部分
- C#根据网址获取域名,目录名,文件名函数
- 解析PHP获取当前网址及域名的实现代码
- 《写给大家看的c语言书》中所用部分函数解析
- 解决域名无法解析的网址问题
- x264部分函数解析
- ios修改hosts文件后访问网址114导航域名无法解析问题
- UNIX环境编程学习笔记------编程实例----域名解析函数的函数原型即getaddrinfo()函数原型
- C#根据网址获取域名,目录名,文件名函数
- 一个DNS转发故障,造成的部分域名不能解析的解决方法
- QDateTime类的部分函数使用解析
- 解析PHP获取当前网址及域名的实现代码