[thelist] Email Validator 2

Matthew Blanchard blanchardmatthew at hotmail.com
Thu Dec 6 11:46:25 CST 2001


> From: "Shoshannah Forbes" <xslf at xslf.com>
> Subject: [thelist] Email Validator 2

> >
> > In the above expression, you could make the dot optional by following it
> > with a question mark like this:
> >
> > \.?[A-Za-z0-9]+$/
> >
> > The question mark there means ONLY a single dot is allowed, but the dot
is
> > optional. Change the ? to an asterisk (\.*[A-Za-z0-9]+$) and it becomes
> > "ANY number of dots are allowed, but they are optional". Thus the ? will
> > prevent the validation from passing whatever at whatever..com.
>

> I wonder what it will do with email addresses like
> firstname.lastname at someplace.com

> How would it deal with my home address, which has two dots?
> xslf at netvision.net.il ?

Chris suggested a way to make the original code
(http://tech.irt.org/articles/js049/index.htm) accept addresses that don't
have any dots after the '@'.

Both the original code and Chris's "fix" can handle the examples you gave.

> On the other hand, when I have to enter an address and I don't want to, I
> use example at example.com --> since I know example.com is reserved, I know
> that know one ever will get any email sent there, thus I am not spamming
> some third party.

I appreciate your thoughtfulness (I'm a spoiled person; I usually enter
"billg at microsoft.com" ;-)

Where is it written that 'example' is reserved?






More information about the thelist mailing list