usvpn Posted November 23, 2012 Posted November 23, 2012 This is a long and complicated process to make a 100% accurate regular expression to validate email address, but, I have a good one with 2 bugs, it reports the following valid email addresses as invalid: user@domain.museum (6 letter domain which is only museum?!) user@1domain.com (domain cannot start with numbers!) Since I am not familiar with regular expressions I want to know if anyone knows how to fix this 2 bugs? Please explain each of them separately so in case I don't want to use the 1st fix I can! Dim AddressPattern As String = _ "^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@" & _ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?" & _ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\." & _ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?" & _ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|" & _ "([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$" Quote
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.