From: Mathieu Bouchard Date: 2001-03-18T02:55:34+09:00 Subject: [ruby-talk:12780] Re: email address regexp On Sun, 18 Mar 2001, Cameron Laird wrote: > In article , > Randal L. Schwartz wrote: > >which I include here to show that it's not a simple regex: > There are several positive results to emphasize here: > 1. Regexps are great for some things, impossible > for others, and ... clumsy for still others. > e-mail addresses nicely demonstrate that the > third category is non-empty. If you look at Merlyn's post, you'll notice that the big regexp validates most kinds of URL. You can then extract the 5 lines that apply to email addresses (starting at "(?:mailto:") I'll assume Merlyn's post's purpose is to show off Abigail's ability to write code that looks like the output of a compiler. Besides, Larry thinks LISP looks like nail clippings in oatmeal. I don't know what he thinks about that regexp, but I think I prefer LISP. A big improvement to the regexp (the email part or the whole) would be to rewrite it as a bunch of functions that each generate parts of the regexp. Each part would be given a name and redundancy would be eliminated. If properly done it could even look like a grammar description. matju