当前位置: 首页 > 图文教程 > 网络编程 > 正则表达式 > asp 正则表达式检测http开头的函数

正则表达式
过滤所有HTML代码和CSS,JS
正则表达式的语法
JScript 和 VBScript 正则表达式
ASP.NET 中的正则表达式
我的正则
正则表达式,提取网页中的链接地址
如何删除文本框里的文字内容中段落之间多余的分行
完美替换html代码
限制文本框中只能输入实数或整数,其它字符无效,有劳大家了!
<meta>正则
正则表达式中使用变量赋值
一个正则的写法 php
正则表达式基础
正则表达式学习笔记
如何用正则取input type="text"中的value
[原创]通过脚本清空标签p中的class名和style
[原创]VBS中的正则表达式的用法大全
正则表达式的使用 ASP
去html代码的正则 推荐
正则表达式的应用

asp 正则表达式检测http开头的函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 37 ::
收藏到网摘: n/a

'####################################
'函数:ishttp[str]
'参数:str,待处理的字符串
'作者:木木
'日期:2007/7/12
'描述:检测HTTP连接地址或地址栏是否以HTTP开头
'示例:<%=ishttp(http://www.alixixi.com)%>
'####################################
Function ishttp(str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(http|HTTP)[A-Za-z]{0,1}\:\/\/"
ishttp = regEx.Test(str)
End function
验证邮件地址是否符合标准
<%
'******************************
'函数:isemail(strng)
'参数:strng,待验证的邮件地址
'作者:阿里西西
'日期:2007/7/13
'描述:验证邮件地址是否符合标准
'示例:<%=isemail([email protected])%>
'******************************
Function isemail(strng)
isemail = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then isemail= true
End Function
%>
正则表达式检测中国移动电话手机号码'*********************************************************
'函数:mobilecheck[str]
'参数:str,待处理的字符串
'作者:木木
'日期:2007/7/12
'描述:检测移动电话手机号码
'示例:<%=mobilecheck("13912345678")%>
'*********************************************************

Function mobilecheck(str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(13[4-9]|15(8|9))\d{8}$"
mobilecheck= regEx.Test(str)
End Function