I\'m working on a small project in VB.Net where I get a input from a textbox, and need to verify that this is an e-email address.
I found this expression \"^[_a-z0-9
Email address: RFC 2822 (simplified) Matches a normal email address. Does not check the top-level domain. Requires the "case insensitive" option to be ON.
Dim FoundMatch As Boolean
Try
FoundMatch = Regex.IsMatch(txtEmail.text, "\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase)
Catch ex As ArgumentException
'Syntax error in the regular expression
End Try
If Not FoundMatch Then
Error = True
Else
Error = False
End If