ReaImDown Posted December 1, 2007 Share Posted December 1, 2007 I was wondering how I would check a user input and verify that is is a PROPER Email. IE, VALID Emails XXXX@XXXX.XXX INVALID Emails XXXX@XXXXXXX XXXXXXXX.XXX XXXXXXXXXXX Randy S. [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
weaponx Posted December 1, 2007 Share Posted December 1, 2007 (edited) Description: This pattern allows standard e-mail addresses (e.g. user@domain.com), sub domains (e.g. user@foo.domain.com), the new two- and four-letter domains (e.g. user@domain.tv and user@domain.name) and country codes (e.g. user@foo.com.us). Also, this patter follows the Network Solutions standard length of 67 characters for top-level domains. The reason I allow numbers to be entered in the domain suffix is for future planning. If you do not want numbers to be able to be added as a domain suffix (e.g. user@domain.123), simply delete the last two occurrences of "\d". Matches: foo@foo.com|||foo@foo-foo.com.au|||foo@foo.foo.info Non-Matches: foo@.com|||foo@foo..com|||foo@me@.com Author: Laurence O'Donnell $email = "billgates@microsoft.com" $result = StringRegExp($email,"^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})|([\w\d\-]+\.[\w\d\-]{1,67}))\.(([a-zA-Z\d]{2,4})(\.[a-zA-Z\d]{2})?)$", 0) MsgBox(0,"",$result) Taken from: http://regexlib.com/DisplayPatterns.aspx Edited December 1, 2007 by weaponx Link to comment Share on other sites More sharing options...
Paulie Posted December 1, 2007 Share Posted December 1, 2007 (edited) You could use StringRegExp() to verify Syntax, but when it comes to actual domain validity, maybe you could search for verifiers online Edited December 1, 2007 by Paulie Link to comment Share on other sites More sharing options...
ReaImDown Posted December 1, 2007 Author Share Posted December 1, 2007 (edited) $email = "billgates@microsoft.com" $result = StringRegExp($email,"^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})|([\w\d\-]+\.[\w\d\-]{1,67}))\.(([a-zA-Z\d]{2,4})(\.[a-zA-Z\d]{2})?){:content:}quot;, 0) MsgBox(0,"",$result) Taken from: http://regexlib.com/DisplayPatterns.aspx hmmm, I tried it, and I got an error... "Error: Unterminated string." hmmm, its missing a " somewhere Edited December 1, 2007 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
weaponx Posted December 1, 2007 Share Posted December 1, 2007 Fixed, try it now. Link to comment Share on other sites More sharing options...
ReaImDown Posted December 1, 2007 Author Share Posted December 1, 2007 Fixed, try it now.so, it will only return 1 or 0? 1 = good email, 0 = bad, cool, thank you [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
weaponx Posted December 2, 2007 Share Posted December 2, 2007 so, it will only return 1 or 0? 1 = good email, 0 = bad, cool, thank you 1 = Valid0 = Invalid Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now