OK, having some fun here and need a little help, 'cause my regex skills 
are pretty rusty and there are many here with far greater knowledge on 
this area than I.

We have some scheduled processes that parse feed files and retrieve 
images from remote vendors via cfhttp calls every night. Problem was, 
sometimes the feed files would have malformed (or incomplete) URL's, so 
we would get a flood of error emails in those instances. Last week I 
pulled a great UDF (shown below) off of CFLib for testing URL validity. 
Seemed to be working great, but the problem is that the regex excludes 
'(' and ')' signs, which are used in some of these URL's. How would I 
adjust the regex to no longer exclude these two characters?

<cfscript>
/**
  * A quick way to test if a string is a URL
  *
  * @param stringToCheck         The string to check.
  * @return Returns a boolean.
  * @author Nathan Dintenfass ([EMAIL PROTECTED])
  * @version 1, November 22, 2001
  */
function isURL(stringToCheck){
                return 
REFindNoCase("^(((https?:|ftp:|gopher:)\/\/))[-[:alnum:]\?%,\.\/&##!@:=\+~_]+[A-Za-z0-9\/]$",stringToCheck)
 
NEQ 0;
        }
</cfscript>

TIA to anyone and everyone who can help me with a solution to this issue.
-- 
Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
http://blog.cutterscrossing.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278758
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to