This was discussed recently and the following RegEx was recommended.  It
also supports the new top level domains.

<CFSET MyEmail = "[EMAIL PROTECTED]">

<CFIF
REFindNoCase("^['_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-
z]{2,3})|(aero|coop|info|museum|name))$",MyEmail)>
        Valid email
<CFELSE>
        Invalid email
</CFIF>

Chris Lofback
Sr. Web Developer

TRX Integration
28051 US 19 N., Ste. C
Clearwater, FL  33761
www.trxi.com


-----Original Message-----
From: Jeff Green [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 9:36 PM
To: CF-Talk
Subject: Email regex


Hi all,

Im working on a regular expression for matching an email.

So far I have this:
[-A-Za-z0-9_\.]+[@][-A-Za-z0-9_]+([\.][-A-Za-z0-9]+)+

used like this:
<CFSET EmailPos =
REFindNoCase("[-A-Za-z0-9_\.]+[@][-A-Za-z0-9_]+([\.][-A-Za-z0-9]+)+",From,1,
"True")>

I swear ive used this before and it worked, although now only the .com or
the .net is matching.

Any ideas,
Jeff

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to