> I don't know very much (i.e. nothing) abut regular expression 
> so excuse my ignorance...
> 
> If my e-mail address is validated then why do you have 
> 
> com|co[.]uk|net|org|com[.]uk)$
> 
> at the end and not .name?
> 
> Giles

Giles,

You're right that if there was nothing else it should not validate, and
actually that code is entirely superfluous to the whole regular expression.
It's not needed at all.

When the regular expression tries to validate the domain, it looks at the
bit after the @ and says:

Do I have a letter or digit?
Do I have 0 or more letters, digits or hyphens?
Do I have a letter or digit?

And then it says:

Is there a period?
If so, then...
DO I have a letter or digit?... Etc as above

So that you get:

(Letter-digit then letter-digit-hyphen then letter-digit then period)
repeating until the end when it doesn't need a period

So to answer your question, ".name" does start with a letter or digit, it
does have letters, digits and hyphens and it does have a letter or digit at
the end.  So it will match despite not being in the list!

Paul




-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to