phreaky Posted May 8, 2005 Posted May 8, 2005 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. Quote tHe pHrEaKy
IngisKahn Posted May 8, 2005 Posted May 8, 2005 Straight from MSDN: 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})(\]?)$") Quote "Who is John Galt?"
phreaky Posted May 8, 2005 Author Posted May 8, 2005 Straight from MSDN: 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 don't 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, I'm kinda newbie with VB .NET, I'm 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. Quote tHe pHrEaKy
Administrators PlausiblyDamp Posted May 8, 2005 Administrators Posted May 8, 2005 At the top of your source file add the line Imports System.Text.RegularExpressions and things should be okay. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.