-5

I found following code from this link.

https://msdn.microsoft.com/en-us/library/01escwtf(v=vs.80).aspx

Function IsValidEmail(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

I dont know how to use above code. I mean how to call above code?

1 Answers1

1

you can use it as below

If IsValidEmail("[email protected]") Then
        'valid email
Else
       'invalid email
End If
Damith
  • 62,401
  • 13
  • 102
  • 153