I think you just need to modify the domain check a little bit...

[[:alnum:]\-_]

Should be

[[:alnum:]_-]

Otherwise you're matching everything between '\' and '_'. The ASCII sequence
this matches is \[^_

Presumably you want to allow only alpha numeric, _ and - in the domain name.

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org


>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Mosh Teitelbaum
>Sent: Thursday, July 01, 2004 6:57 AM
>To: CF-Talk
>Subject: Email Regex with weird results
>
>All:
>
>I've been using a regex found on this list to validate email addresses.
>I've now run into a problem with the regex that I can't solve.
> Any help
>would be greatly appreciated.
>
>The email address is not required so the field can either be
>left blank or
>must contain a valid email address.  The regex validation code follows:
>
><CFIF (Len(Trim(FORM.Email)) NEQ 0) AND
>(REFindNoCase("^[a-zA-Z]([[:alnum:]\-_]+\.?)*@([[:alnum:]\-_]+\
.)+[a-zA-Z]{2
>,4}$", FORM.Email) EQ 0)>
> Email address is invalid
></CFIF>
>
>The email address is of the form "[EMAIL PROTECTED]" (that is, the domain
>contains a dash).  If I remove the dash from the domain, the address
>validates.  However, the dash should be valid.
>
>Looking at the regex, doesn't the ([[:alnum:]\-_]+\.) portion
>after the @
>symbol allow for dashes?
>
>TIA
>
>--
>Mosh Teitelbaum
>evoch, LLC
>Tel: (301) 942-5378
>Fax: (301) 933-3651
>Email: [EMAIL PROTECTED]
>WWW: http://www.evoch.com/
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to