学院首页 新手上路 建站指南 主页制作 图片处理 动画制作 网站编程 制作软件 网站发布 技术论坛 大宝库主页
当前位置:学院首页 >> 网站编程 >> asp >> 正文

ASP:用vbscript判断email地址的合法性
转自: 时间:2003-12-4 12:33:00

这里是一断正则表达式的例子
<%
Function isemail(strng)
isemail = false
Dim regEx, Match ' Create variables.
Set regEx = New RegExp ' Create a regular expression object (stupid, huh?)
regEx.Pattern = "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$" ' Sets pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
Set Match = regEx.Execute(strng) ' Execute search.
if match.count then isemail= true
End Function
%>


(编辑:dabaoku)
发表评论】【关闭窗口