用VBSCRIPT判断EMAIL地址的合法性
类别: ASP教程
这里是一断正则表达式的例子
<%
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
%>
<%
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
%>
- 上一篇: 可以近视替代REMOTE SCRIPT的代码
- 下一篇: 将HTML表单数据存储为XML格式
-= 资 源 教 程 =-
文 章 搜 索