by e7mac on 12/21/14, 11:39 AM with 5 comments
by _jomo on 12/21/14, 2:09 PM
> I did not write this regular expression by hand. It is generated by the Perl module by concatenating a simpler set of regular expressions that relate directly to the grammar defined in the RFC.
There's also the famous xkcd Regex Golf [1]. Peter Norvig writes:
>So that got me thinking: can I come up with an algorithm to find a short regex that matches the winners and not the losers?
And he described his steps to create a RegEx using a list of words that must be matched and those that must not be matched [2]
[0]: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
[2]: http://nbviewer.ipython.org/url/norvig.com/ipython/xkcd1313....
by alansammarone on 12/21/14, 1:06 PM