Subject: Bonus Points: $25 Voucher (05.23.2014)

From: $25 for Veterans <[email-masked]>
Date: Fri, 23 May 2014 11:38:27 -0700

ATTN: Atompub-archive
Macy's Rewards
Exclusive for May 2014
-------------------------

Greetings Atompub-archive,

In honor of Memorial Day and our Veterans we are giving you $25.

To Enjoy Your Macy's Rewards, all you need to do:

1) Visit:  http://www.soxbug.com/redeem/macy's/giftCard.index
2) Give us your opinion 
3) Redeem your Shopper Bucks before they expire on May 23, 2014

Happy Memorial Day,

Member Rewards Program

/ Alert System Notifications Message settings /
to-modify-write-1107 V a l e r i a D r i v e-Marion, TX 78124
http://www.soxbug.com/kgjo4/gmo4l.snbgo4

Could someone explain what this will and won't match against? (Given some of the additional answers below.) It would be nice to know a bit more information in order to determine which 'solution' to use for a project.   Jon Jul 7 '10 at 17:18
+1: Only thing this won't let through are IPs instead of domains. It does accept domains starting or ending with a dash, and domains in excess of 64 chars in length, but other than this does a good enough job. Cheers.   Umber Ferrule Jul 19 '10 at 9:48 
199This regex eliminates valid, in-use emails. Do not use. Google for "RFC822" or "RFC2822" to get a proper regex.   Randal Schwartz Sep 8 '10 at 2:34
2@Randall: Can you give an example of an email address that this won't let through?   rossipedia Sep 14 '10 at 18:08This works well for me, though I do get a complier error (unescaped '[') when using it with Appcelerator. Doesn't seem to cause a problem with the validation at all, however.   evanmcd Feb 12 '11 at 19:01
Note that any IDNs will have to be punycoded before this regex accepts them; any valid top-level IDNs will be rejected even in punycode form (as the xn- prefix won't match [a-zA-Z]).   Piskvor Jun 6 '11 at 1:20
19	-1 you will never match all valid email addresses with a regular expression   Brad Mace Jul 9 '11 at 4:32
78	"...JavaScript can easily be disabled. This should be validated on the server side as well." It is possible that this IS for server-side validation a la Node.js =)   mkoistinen Jul 19 '11 at 21:20
2Why on var re = ... line JSLint says: Unescaped ']', unescaped '[', spaces are hard to count, use {2}?   manakor Sep 30 '11 at 8:45 Added a live demo.   ripper234 Jan 12 '12 at 12:27There's a full test case of email addresses astor more details).   Chris J Apr 4 '12 at 7:56
Someone post some legitimate email addresses that this won't validate, or some illegitimate ones that it will, and I'll consider stopping using it. Until then, good work.   Ben Roberts Jun 9 '12 at 13:51
1	  	There is a section oalidation on the bottom of this page:   Dan Osipov Jun 14 '12 at 18:26Nice, but there are simpler and more effective solutions below.   user83358 Jul 30 '12 at 18:24
  	  	what does eans? where the test function from? please advice?   Ben Sep 21 '12 at 22:10this fails on lint   Kirk Strobeck Oct 12 '12 at 16:10This doesn't even accept the examplome simple cases it doesn't match a\@[email-masked], a(b)@c.com. See the RFC for more. Here's a regex that won't reject any valid addresses  protects against common errors.   Vroo Oct 26 '12 at 6:32 This works good enough for me. I'll settle for 99.999% accuracy.   Henley Chiu Nov 1 '12 at 1:582	  JSLint doesn't like this very much   RyanM Nov 19 '12 at 22:42
 @ sectrean, i just tried your javascript code. Its showins valid email id. How come that email id is valid?   Akshinth 2- valid email address, in use, it fails   Good Person Dec 21 '12 at 22:22
@GoodPerson I just tried to email n@ai to tell him/her they have a cool email address. But alas, gmail wouldn't let me. I suspect whoever that is has bigger problems communicating with others via email than just my site's javascript validation! But thanks for rising to the challenge.   Ben Roberts Jan 13 '13 at 7:38 
 I am wondering why when I entered [email-masked] it accepted the email? Meaning '#' is allowed?   Jobert Enamno Jan 14 '13 at 9:43 In my opinion it's a good thing to reject ridiculous email addresses with escaped `@' signs and such. If some Mr L@me wants to use my sites, he will have to get a sensible email address first.   Sam Watkins Mar 8 '13 at 2:08 
What is the license you put on this regex. (I don't feel good to copy and paste it to my code without permission)   bluesm Mar 16 '13 at 7:08 It's worth noting that the regexp in this answer should be written in one line, altough it is copied with multiple lines.   ribot Mar 30 '13 at 14:00This is a solution that seems good with most native English speakers, but it fails the Turkey test (see Joel Spolsky). Most unicode letters are allowed, and for instance in Argentina, addresses such as "[email-masked]" is perfectly normal. joelonsoftware.com/articles/Unicode.html   oligofren Apr 16 '13 at 15:20 underscore(_) should be validated at first place I guess.   Balwant Kumar Singh Apr 29 '13 at 10:52
@bluesm - "All contributions are licensed under Creative Commons..."   Merlyn Morgan-Graham Jun 1 '13 at 21:26
will fail for this kind of form  pradeek Jun 5 '13 at 2:02 I'm not sure why this has so many up votes, but using regular expressions doesn't work for validating email addresses.   Boundless Jun 26 '13 at 14:59Examples of valid e-mail addresses that are marked as invalid are postbox@com and user@[IPv6:2001:db8:1ff::a0b:dbyou doubt me SyntaxError: Invalid regular expression: missing /   Yann Chabot Jul 17 '13 at 14:29full test regex :    Alban Jul 23 '13 at 15:05
This is the only regex that worked for me :]   Gillian Lo Wong Aug 29 '13 at 13:13 
@Ben it's the generic built in method in a regular expression.   Alex Oct 21 '13 at 12:24
This passes for @a.aa (that first char is a weird one), which recently messed u
12	For all the people commenting that this is "good enough": look, you're simply thinking about this problem wrong. That's OK. It's a choice you can make for your users. I ain't mad at it. But, you know, technically speaking, you're demonstratively, provably wrong.   lwburk Nov 22 '13 at 16:32... and validated by a Database procedure as well.   Rolf Jan 8 at 14:04its broke for hhhkkk :(   Nikhil M Jan 29 at 4:26You cannot validate email addresses, period!! The only one who can validate an email address is the provider of the email address. So why would you try? For example, this answer says these email addresses: [email-masked], "%2"@gmail.com, "a..b"@gmail.com, "a_b"@gmail.com, [email-masked], [email-masked] , [email-masked] are all valid, but Gmail will never allow any of these email addresses. You should do this by accepting the email address and sending an email message to that email address, with a code/link the user must visit to confirm validity.   Kevin Fegan Feb 1 at 
 8:49For more info about what it (in)correctly matches see the following list st-pattern/MTA4   PeeHaa Feb 5 at 12:37
@BenRobertoesn't exist. And yet the regex will let it through.   josaphatv Mar 13 at 13:38@josphatv I assume you're joking. But based on your legitimate interpretation of my comment, I guess I need to stop using this regex!