On Mon, Jan 07, 2002 at 04:42:28PM +0530, Philip S. Tellis wrote:
> On Mon, 7 Jan 2002, Binand Raj S. wrote:
> 
> > For scripts that depend upon '@' to extract mail ids, I suggest the
> > regex in the following command:
> > 
> > grep <.*@[^>]*> /var/spool/mail/binand
> 
> Anyone who's read Mastering Regular Expressions (Jeffrey Friedl) knows 
> that the correct regex to match an email address is about 7000+ bytes 
> long.  There is a shorter version (4000+ bytes), but it is slower.

Wow! That'll be some regex.

But I guess this is for parsing an address, as opposed to checking whether
a sequence of characters is a syntactically correct address or not.
Mind you, <[EMAIL PROTECTED]> is a valid email address *syntactically*.

Anyway, my regex is also not completely 2822 compliant - was reading
through it, and there are a bunch of exceptions and special cases (eg:
mine trips over local delivery, <name> type of addresses).

Binand

PS: Did you mean 'optimal' when you said correct up there? Otherwise
why isn't the 4000 character version more correct, so to speak?


_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to