email id validations

zarina

Member
Joined
Nov 30, 2005
Messages
8
Programming Experience
Beginner
hi,
i want to know how to validate emailid in a textbox in vb.net.I should get a popup for an invalid emailid that is it should contain "@".

with regards,
zarina
 
for winforms here how i do it:

Private myRegEx As New System.Text.RegularExpressions.Regex("^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$")

then just use myRegEx.IsMatch(Textbox.Text) to determine if a valid email address has been typed in
 
Back
Top