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

正则表达式
正则在FireFox和IE下使用test的不同
正确使用带有"g"标记的javascript正则表达式
正则表达式 学习资料整理
javascript 正则表达式用法 小结
正则匹配的test函数
JavaScript 正则表达式 验证整数、小数、实数、有效位小数最简单
检测八位数字是否为有效日期的正则
editplus EmEditor和searchandreplace正则表达式
正则应用之 日期正则表达式
正则表达式 学习参考 推荐入门者看
正则基础之 \b 单词边界
正则基础之 小数点
正则 捕获组(capture group)
Dreamweaver 正则替换(返回调用值)
JavaScript 表单验证正则表达式大全[推荐]
JavaScript 使用正则表达式进行表单验证的示例代码
获取网址路径的正则
去除段首段尾的 和全角的空格的正则
正则表达式匹配任意字符(包括换行符)的写法
EditPlus 正则表达式替换字符串详解

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 46 ::
收藏到网摘: 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