Or <cfset sourceString = "The.Quick.Brown.Fox" /> <cfset result = listDeleteAt(sourceString, listLen(sourceString, "."), ".") /> <cfdump var="#result#" />
Regards Dale Fraser http://learncf.com -----Original Message----- From: Todd [mailto:[EMAIL PROTECTED] Sent: Thursday, 8 November 2007 7:39 AM To: CF-Talk Subject: Re: How do I get the characters after the last period in a string? Scratch the last, use this instead: <cfset blah = "as.d.f.l.as...d.f.a.s.dfasdf.jpg"> <cfdump var="#rematch('[^\s]+(?=\.(jpg|gif|png)$)',blah)#"> On Nov 7, 2007 3:31 PM, Todd <[EMAIL PROTECTED]> wrote: > > <cfset blah = "asdflas.dfas.dfasdf.jpg"> > <cfdump var="#rematch('[^\s]+(?=\.(jpg|gif|png))\.',blah)#"> > > On Nov 7, 2007 1:58 PM, Rick Faircloth < [EMAIL PROTECTED]> wrote: > > > You know... a better solution than what I've got, which is > > to only deal with as many as two periods in a filename, is needed. > > The current solution leaves some gaps if a user decides to user several > > periods as delimiters. And stripping out the periods, except for the > > one > > before the extension might cause name conflicts. > > > > Todd... what would be the regex for deleting just the last period > > in a filename plux the extension? > > > > Rick > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292911 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4