That's C#. Translated to VB:
Imports System.Text.RegularExpressions
Public Function IsValidRegexValidEMail(ByVal ValueToTest As String) As
Boolean
Const RegexValidEMail As String =
"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"
IsValidRegexValidEMail = Regex.IsMatch(ValueToTest, RegexValidEMail)
End Function
Regular expression doesn't check the length of the address and may miss
few valid addresses with special chars. See
http://en.wikipedia.org/wiki/E-mail_address
Checking domains requires a third party component as far as I know. If
someone
knows a way how to do it in VB I'd like to know too.
In the first place checking domains (or MX records) may not be feasible. It
tends to
be slow unless you have only a few email address.
- Timo
<ne***************@charter.netwrote in message
news:Vc****************@newsfe04.lga...
>
public const string
RegexValidEMail =
@"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$";
static public bool IsValidRegexValidEMail (string ValueToTest)
{ return Regex.IsMatch(ValueToTest, RegexValidEMail); }