'####################################
'函数: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
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
re正则表达式练习
判断变量名是否符合要求import re names = ["name1","_name","2_name","...
[阅读全文]
-
-
常用前端相关知识
1.字符串.replace(正则, function(v,i,str){ return 'xxx' }) //...
[阅读全文]
-
-
-
-
-
-
-
网友评论