![]() Topic awaiting preservation: Really Solid Email Validation Regular Expression? (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() I am looking for a really solid email validation regular expression. I have worked with a bunch in the past, but none of them were what I would considerer hardened. Anyone have on that really follows the Standards? |
Maniac (V) Inmate From: Sthlm, Sweden |
![]() this is what I usually use, no idea on how good it really is: |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() Woah! |
Paranoid (IV) Mad Librarian From: Glienicke |
![]() I have used this one from Trib's GN tutorial: code: ^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$
|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() EDIT: seems as if there are parts that get autolinked, and the code tag doesnt show everything in the line. |
Maniac (V) Inmate From: Sthlm, Sweden |
![]() WarMage, well I never ever said I was any good with regexes... |
Paranoid (IV) Inmate From: Minneapolis |
![]() One of my employees created this one directly from the spec, and I think it's about as good as it gets without trying to validate actual top-level domains: code: /^[-^!#$%&'*+\/=?`{|}~.\w]+@[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])*)+$/
|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() code: function validate($email){
|
Maniac (V) Inmate From: Boston, MA, USA |
![]() Helpful stuff: |
Paranoid (IV) Inmate From: Minneapolis |
![]() Here's the original function, short and sweet: |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() This thread reminds me how if I want to act like programming is some mystical black art ( which we all know it really isn't) I just show my audience any regular expression I'm working on. |