G
Guest
Hi
How to validate an email address in windows application
Thanks in advance
How to validate an email address in windows application
Thanks in advance
Public Shared Function IsValidEmail(ByVal strIn As String) As Boolean
' Return true if strIn is in valid e-mail format.
Return Regex.IsMatch(strIn,
("^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA
-Z]{2,4}|[0-9]{1,3})(\]?)$"))
End Function
APublic Shared Function IsValidEmail(ByVal strIn As String) As Boolean
' Return true if strIn is in valid e-mail format.
Return Regex.IsMatch(strIn,
("^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-z-Z]{2,4}|[0-9]{1,3})(\]?)$"))
End Function
There are many valid email addresses that expression will not validate. The
only serious regex attempt I've seen to match an address, according to the
relevant RFC, was about an entire page long.
--
Abderaware
Fine Components For .NET
Turn on, tune in, download.
zane a@t abderaware.com