<cfset value = REReplace( 
"/level-1/2nd-level/index.cfm"
"/([^/]+)/.*",
"\1",
"ONE"
) /> 

This puts the first "directory" (level-1) into the first group
reference. Then it replaces the entire string with that group reference.


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Mark Leder [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 20, 2007 5:03 PM
To: CF-Talk
Subject: RegEx help

I'm really not very good at this, so I'm grateful for any help.  I've
been using one of those regex editors, but I just can't seem to get my
head around the way it's used (regEx buddy).

What I want to do is take a URL string, such as
"/level-1/2nd-level/index.cfm" and just keep the string which is between
the first set of "/" ("level-1" no quotes).  How would this be written?

Thanks,

Mark






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

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

Reply via email to