Topic awaiting preservation: Really Solid Email Validation Regular Expression? |
|
---|---|
Author | Thread |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 05-03-2005 16:15
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 |
posted 05-03-2005 18:22
this is what I usually use, no idea on how good it really is: |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 05-03-2005 20:25
Woah! |
Paranoid (IV) Mad Librarian From: Glienicke |
posted 05-03-2005 20:52
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 |
posted 05-03-2005 20:59 |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 05-03-2005 21:01
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 |
posted 05-03-2005 22:14
WarMage, well I never ever said I was any good with regexes... |
Paranoid (IV) Inmate From: Minneapolis |
posted 05-13-2005 22:08
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 |
posted 05-14-2005 18:06 |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 05-15-2005 00:45
code: function validate($email){
|
Maniac (V) Inmate From: Boston, MA, USA |
posted 05-15-2005 13:36
Helpful stuff: |
Paranoid (IV) Inmate From: Minneapolis |
posted 05-19-2005 17:04
Here's the original function, short and sweet: |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-19-2005 18:14
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. |