用vbscript可以这样写
<%
Function isemail(strng)
isemail = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "[A-Za-z0-9_]+"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then isemail= true
End Function
%>
模式你可以自己改
2、判断Email格式的正确性
<%
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
%>
3.UBB论坛
Function ReplaceTest(patrn,str,replStr)
Dim regEx, str1 " 建立变量。
str1=trim(str)
Set regEx = New RegExp " 建立正则表达式。
regEx.Pattern = patrn " 设置模式。
regEx.IgnoreCase = true " 设置是否区分大小写。
ReplaceTest = regEx.Replace(str1, replStr) " 作替换。
set regEx=nothing ‘销毁正则表达式对象
End Function