Email verification in ASP VBScript

This is the simple function for email verification in vbscript using regular expression.

Function IsValidEmail(byval sEmail)

dim regEx
set regEx = New RegExp

regEx.Pattern = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"

IsValidEmail = regEx.Test(sEmail)

End Function

No comments:

Post a Comment

David World