专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »编程综合 » 正则表达式开头:asp 正则表达式检测http开头的函数 »正文

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

来源: 发布时间:星期日, 2009年9月6日 浏览:18次 评论:0
'####################################
':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)
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
0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: