sub IsEmail(EmailAddress As String) as Boolean
Dim MatchEmail As Matcher = Regex.Matcher("^(?i)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])$", EmailAddress)
If MatchEmail.Find = True Then
Log(MatchEmail.Match)
'Do something
return true
Else
Log("Oops, please double check your email address")
return false
End If
end sub
'
' Example
'
Dim EmailAddress As String = "Hewlett-Packard@HPforyou.hp.com"
log(IsEmail(EMailAddress))