Imports System.Text.RegularExpressions
Dim emailRegex As New System.Text.RegularExpressions.Regex("^(?<user>[^@]+)@(?<host>.+)$")
Dim emailMatch As System.Text.RegularExpressions.Match = emailRegex.Match(TextBox1.Text)
If (emailMatch.Success) Then MsgBox("This email is valid.") Else : MsgBox("This is not a valid email.") End If
Imports System.Text.RegularExpressions Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim emailRegex As New System.Text.RegularExpressions.Regex("^(?<user>[^@]+)@(?<host>.+)$") Dim emailMatch As System.Text.RegularExpressions.Match = emailRegex.Match(TextBox1.Text) If (emailMatch.Success) Then MsgBox("This email is valid.") Else : MsgBox("This is not a valid email.") End If End Sub End Class