Validating email address

phreaky

Well-known member
Joined
Dec 7, 2002
Messages
71
Location
Caracas, Venezuela
Anyone has a code for validating email address (offline), I mean, to validate that the user type a good format (user@host.ext) in email txtbox? VB talking of course.
 
Straight from MSDN:

Code:
Regex.IsMatch(address, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
 
IngisKahn said:
Straight from MSDN:

Code:
Regex.IsMatch(address, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")


Well...thanks Ingis, but I dont know how to use what you gave me, because "Regex" is not a native function of VB, could you please teach me a little more about it? Sorry to bother, Im kinda newbie with VB .NET, Im using a txtbox, so, could you give me a piece of code using my txt_cariable.text, so I can use it? Thanks anyway for you concerning.
 
Back
Top