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

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

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

  2021-03-18 我要评论
想了解asp 正则表达式检测http开头的函数的相关内容吗,在本文为您仔细讲解的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:asp,正则表达式检测http开头的函数,下面大家一起来学习吧。
'####################################
'函数: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

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们