Try this.. I use this validation:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

BUT in the Jquery.Validate.js find the function on line* 964 *starting with
*:email:function*
(By Scott Gonzalez) and replace the WHOLE regex with the regex below.  It
seem to cover everything, even TLD's that are 5 chars.


^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$


On Fri, Aug 14, 2009 at 4:09 PM, Imperial, Robert
<[email protected]>wrote:

>
> Unfortunately the project I am working on doesn't use cfform at all, its
> all homegrown error handling. Never cared much for cfform actually.
>
>
> Bob
>
> -----Original Message-----
> From: Leonard Boche [mailto:[email protected]]
> Sent: Friday, August 14, 2009 4:00 PM
> To: cf-newbie
> Subject: Re: RegEx
>
>
> Hi Bob,
>
> If are simply trying to validate e-mail format, you might
> want to take a look at the validate attribute of the <cfinput>
> which can be evaluated at submission.
>
> Validate: A valid e-mail address of the form [email protected].
> ColdFusion validates the format only; it does not check that entry
> is a valid active e-mail address.
>
> As for checking for the .edu component, try something like below.
>
> <cfset email_ext = right(#form.email_address#,4)>
>
> <cfif IsDefined('email_ext') AND Trim(email_ext) neq ".edu">
>   <p>Place error message here</p>
> <cfelse>
>   <p>Complete the process code here</p>
> </cfif>
>
> The above code would be included in your processing/action section.
> It will get the last for elements of the e-mail address i.e.: .***
> and then the IsDefined process will let you evaluate if it is equal
> to .edu which you then can process accordingly.
>
> Leonard
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4716
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to