From: Sam Roberts Date: 2003-01-27T08:16:34+09:00 Subject: Re: common regular expressions Quoteing dcarrera@math.umd.edu, on Mon, Jan 27, 2003 at 05:53:51AM +0900: > On Mon, Jan 27, 2003 at 05:41:17AM +0900, Sam Roberts wrote: > > > How about we take: > > > > "hi y@"."ruby \",master!" ( ... a comment!!) @ u%me . u+me . u-me > > > > its syntactically valid, too! Though admittedly unusual... > > I only meant to write an "approximate" RE that would work most of the Oh, hey, I know that! I wasn't trying to trash your regexp. > It' time. Writing a truly comprehensive RE would be very difficult and > probably not even worth it. Yep, but + and - in domain names isn't too uncommon, and you still see email addresses with the %-hack for uucp in the local-part. Anyhow, its actually not too hard to write a RE from the BNF in RFC822, particularly if you ignore some deprecated by RFC2822 stuff, but luckily, we don't have to, because you can find the RE in the excellent book you recommended, Mastering Regular Expressions. I picked it up because I couldn't believe REs were complicated enough to need a whole book, and then kept reading out of amazement. Cheers, Sam