Hi,

Ive got a system where we allow a user to upload a CSV containing
addressbook entries.  I run a RegEx Email validation to check that the
email of the record is in an appropriate format.  Currently I have the
following:

<cfset sPattern =
"([a-z0-9][-._a-z0-9]*)[EMAIL PROTECTED],1}([a-z0-9][-_a-z0-9]*\.)+[a-z]{2,7}"
/>
return IIF(REFindNoCase(sFormatPattern, str) EQ 1, true, false);


And similarly in the Javascript:

var emailFilter =
/([a-zA-Z0-9][-._a-zA-Z0-9]*)[EMAIL 
PROTECTED],1}([a-zA-Z0-9][-_a-zA-Z0-9]*\.)+[a-zA-Z]{2,7}/g;
return emailFilter.test(sEmail);


Using an email address of:

foobar.foobar.foobar.mediroute.snet.co.uk

causes the browser (for the javascript) to 'hang' using all the CPU
and causes CF to do similar (thus never rreturning the page to the
user)


Why is this happening, and how can I avoid potential problems like
this in the future.


Thanks in advance

Jedi

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:21:878
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to