Simple regular expression I found and have used succesfully to validate emails submitted to my website.
VB Code:
Imports System.Text.RegularExpressions Function EmailAddressCheck(ByVal emailAddress As String) As Boolean Dim pattern As String = "^[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]$" Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern) If emailAddressMatch.Success Then EmailAddressCheck = True Else EmailAddressCheck = False End If End Function


Reply With Quote


