dim a,b
a=split(yourstring,"@")
if ubound(a)<>1 then'非法
b=split(a(1),".")
if ubound(b)<1 then'非法
保证形式是???@???.???
a=split(yourstring,"@")
if ubound(a)<>1 then'非法
b=split(a(1),".")
if ubound(b)<1 then'非法
保证形式是???@???.???
匹配邮件地址的模式串是:
"^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
Private Function IsGoodEmail(ByVal sEmail As String) As Boolean Dim i As Integer
Dim j As Integer
Dim t As Integer
IsGoodEmail = False
sEmail = Trim(sEmail)
j = Len(sEmail)
If j < 5 Then Exit Function
i = InStr(sEmail, "@")
If i = 0 Or i > j - 3 Then Exit Function
t = InStrRev(sEmail, "@")
If t <> i Then Exit Function
t = InStrRev(sEmail, ".")
If t = 0 Or t < i Or t = j Then Exit Function
IsGoodEmail = TrueEnd Function