From: "Benjamin J. Tilly" Date: 2001-03-20T22:34:01+09:00 Subject: [ruby-talk:12938] Re: email address regexp >===== Original Message From merlyn@stonehenge.com (Randal L. Schwartz) ===== >>>>> "Mathieu" == Mathieu Bouchard writes: > [...] >Mathieu> A big improvement to the regexp (the email part or the whole) >Mathieu> would be to rewrite it as a bunch of functions that each >Mathieu> generate parts of the regexp. Each part would be given a >Mathieu> name and redundancy would be eliminated. If properly done it >Mathieu> could even look like a grammar description. > >Yes, that's how this regex was generated! The text is detailed >in Jeffrey's book. > >Even with this regexp, only one level of comments is parsed. Nested >comments would not be matched, and regexp can't match arbitrarily >nested things anyway, so it wouldn't matter. I forget the trick that does it, but in Perl 5.6 Ilya finally put enough RE extensions into the engine that a Perl RE actually can handle arbitrarily nested things. This can't, of course, be made to work in any other language that offers REs. But give it time... Cheers, Ben