asp正则表达式检测http开头的函数
2023-06-13 09:13:57 时间
"####################################
"函数: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构建基于SQL Server和ASP的全新应用(sqlserver 和)
- ASP程序查询MSSQL数据库的实践经验(asp查询mssql)
- 用MSSQL查询ASP:从初学者到高手(mssql查询asp)
- 利用ASP技术进行MySQL数据库开发(asp可以使用mysql)
- ASP搭配MySQL实现完美源代码(asp mysql源代码)
- ASP程序开发探索之oracle数据库(asp和oracle)
- ASP与Oracle配合实现数据写入(asp oracle写入)
- asp网页邮箱访问
- 可以查询百度排名的asp源码放送了
- [ASP]RegExp对象提供简单的正则表达式支持功能使用说明
- asp验证Ip格式的函数
- asp下连接数据库ASP链接数据库字符串大全总结
- asp.net2个日期之间的整月数的算法
- asp.netURL显示乱码解决方法
- 用asp实现的获取文件夹中文件的个数的代码
- asp.net中DetailsView的使用方法
- 一个Asp.Net的显示分页方法附加实体转换和存储过程带源码下载