A longer version of the email edit

Jay R. Ashworth jra at baylink.com
Sat Feb 4 15:37:20 PST 2006


On Fri, Jan 27, 2006 at 03:47:40PM -0600, Mike Schwartz (PC Support) wrote:
>   Here's the edit from Peter:
> 
> em1    {{A}|{N}|{"&"}|{"-"}|{"_"}|[!" "!]}
> email  {em1 | "."} "@" {em1 {"."}} A A [A]

Note that that's a tiny bit loose; all components after an @ sign are
part of a domain name (except, occasionally, the first one, which might
be a machine name), and domain names are limited to [A-Z0-9-].

Since you're only trying to *spot* email addresses, and not validate
them, this is probably not a problem.

A slightly more important problem is that the LHS of the address can
also contain a "+" sign, and these are not uncommon in email addresses
these days, especially since gmail explicitly supports them.  It's
possible, though not common, that you could find a "%" sign as well.

So the full version of that would probably be

// Typed but not tested
lhs: name [ plushack | pcthack ]
rhs: [ machinedot ] { domaindot } tld
name: {{A}|{N}|{"&"}|{"-"}|{"_"}|[!" "!]}
plushack: "+" name
pcthack: "%" name
machinedot: {{A}|{N}|{"-"}|{"_"}|[!" "!]} "."
domaindot: {{A}|{N}|{"-"}|[!" "!]} "."
tld: A A [{A}]
email: lhs "@" rhs
//

Remember .aero, .name, and .museum, among others.

Did I get all the punctuation right in there, Ken?  Been a while since
I had to write an edit stack from scratch.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274

	A: No.
	Q: Should I include quotations after my message body?


More information about the Filepro-list mailing list