asp 正则表达式检测http开头的函数
2007-08-08 12:05
316 查看
'####################################
'函数: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(ali@alixixi.com)%>
'******************************
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
'函数: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(ali@alixixi.com)%>
'******************************
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
相关文章推荐
- asp 下用正则表达式检测邮箱格式的函数
- asp 下用正则表达式检测邮箱格式的函数
- ASP.NET 使用CustomValidator调用js函数动态修改验证TextBox的正则表达式,无刷新
- 常用正则表达式(轉自http://blog.csdn.net/21aspnet/archive/2007/03/21/1535747.aspx)
- asp 经常用的过滤html正则表达式 及函数
- 检测数组、函数、正则表达式比较好的方法
- ASP超级链接和HTML函数正则表达式 修正版
- asp.net(c#)常用正则表达式实例(http://www.cnblogs.com/Aspnet2007/articles/1230060.html)
- ASP中正则表达式的应用 [收藏自http://news.dvbbs.net/infoView/Article_1833.html]
- JS通用表单验证函数,基于javascript正则表达式http://www.ccvita.com/60.html
- asp中除去html代码的函数(用正则表达式)
- js最强的匹配网址-url的正则表达式:匹配www,http开头的一切网址
- 正则表达式:检测数字字母和下划线组成的字符串,且字符串以字母开头
- ASP超级链接和HTML函数正则表达式 修正版
- Asp正则表达式(RegExp)函数
- C#(ASP.NET)正则表达式 过滤危险字符函数代码 防SQL注入 很全面的SQL关键字过滤
- ASP超级链接和HTML函数正则表达式
- ASP中正则表达式的应用
- Oracle正则表达式函数