4 ms·
That would be the one shown here: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html I don't know a
by EvilTerran 10y ago
That would be the one shown here:
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
I don't know about unicode, but I do note it says it doesn't handle comments (because, apparently, they can be nested - and perl's REs lack recursion).
- jandrese 10y ago> Implementing validation with regular expressions somewhat pushes the limits of what it is sensible to do with regular expressions (rest of the page is filled with line noise) LOL
- justinator 10y agoPerl has supported recursion in regex since around v5.10. The giant regex is not from the Camel book, but from O'Reilly's, Mastering Regular Expressions which does give the example in Perl, but was printed before v5.10 of Perl was released. (3rd ed. of Mastering Expressions was released in 2006; Perl v5.10 was released in 2006.). I believe the regex was published in the very first edition.
- EvilTerran 10y agoAh yes, sorry, it would have been more correct to say "perl's REs lacked recursion at the time ". I use PCRE pretty frequently, so knew that it's supported recursion for some time; but it's been a while since I've done anything non-trivial with perl itself, so couldn't remember if it too had that functionality or I was just getting their feature-sets confused. Evidently I guessed wrong - thanks for the correction.
- 77pt77 10y agoRFC 822 is the Internet's cancer. Really. Email addresses should have never been allowed to have comments. Since every new RFC maintains compatibility with this one, we'll probably be stuck with these poor choices for decades.
- Cyph0n 10y agoEmail addresses allow comments? Who the heck thought that was a smart idea!? I guess this is what you're referring to: James Doe <jdoe@a.com> The email - which is inside the <> - should be parsed correctly, while the rest should be treated as a "comment" [1]. [1]: https://www.cs.tut.fi/~jkorpela/rfc/822addr.html https://www.cs.tut.fi/~jkorpela/rfc/822addr.html
- 77pt77 10y agoNo No. Stuff like: * comments are allowed with parentheses at either end of the local-part; e.g. john.smith(comment)@example.com and (comment)john.smith@example.com are both equivalent to john.smith@example.com. [1] * Also have a look at quotes [1]https://en.wikipedia.org/wiki/Email_address#Local-part https://en.wikipedia.org/wiki/Email_address#Local-part
- Cyph0n 10y agowhat.
- erelde 10y agoGuess I'm in today 10000 who learned something today.
- 77pt77 10y agoI can't understand this sentence. At first I thought you were a bot. Then that your English was not very good. Looking at your history clearly both are false. What did you mean?
- Cyph0n 10y agoI think he meant: "I guess I'm among the 10000 who learned something today".
- strictnein 10y agoThey're referring to this: https://xkcd.com/1053/ https://xkcd.com/1053/
- xiaoma 10y agoAnd the irony is that regular expressions, by definition, can't recurse. Nobody's gonna rename them to turing expressions, though.