><cfset renamedOriginal = regex.replace(cffile.serverFile, "[^a-zA-Z0-9.]",
>"")>

ColdFusion does not have a built in "regex" object, as you are attempting to 
use there.

To perform a regex replace, you need to use 
rereplace("input","regex","replacement")


Also, your regex does not match your description:
> something to remove all non-alphanumeric characters, 
> except the . before the extension.

You are currently accepting any . not just the last one.

Try this instead:

<cfset Extension = ListLast(cffile.ServerFile,'.')/>
<cfset NewFilename = rereplace( cffile.ServerFile , "\W|(\.#Extension#$)" , '' 
, 'all' ) &'.'& Extension />

(Not that is not perfect, but should be good enough for your needs) 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320516
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