Agreed.

/item1/option2/part3/section4


<cfoutput>
item = #listFirst(cgi.path_info, "/")#
<br />
option = #listGetAt(cgi.path_info, 2, "/")#
<br />
part = #listGetAt(cgi.path_info, 3, "/")#
<br />
section = #listLast(cgi.path_info, "/")#
</cfoutput>


----------------------------------------

From: "Carl Von Stetten" <vonner.li...@vonner.net>
Sent: Friday, December 03, 2010 12:36 PM
To: "cf-talk" <cf-talk@houseoffusion.com>
Subject: Re: Regex Question

Robert,

How about treating CGI.path_info as a list, using "/" as your 
delimiter.  Then you can use the various list* functions in CF to parse 
it however you want.

Carl

On 12/3/2010 9:26 AM, Robert Harrison wrote:
> Regex is not my strong suit,  but someone may know this off the top of 
their head.   If I have a long url like:
>
>       http://www.mysite.com/item1/option2/part3/section4
>
> I can use cgi.path_info to get the /item1/option2/part3/section4  part of 
the string.
>
> Now is there an easy regex that could let me get the
>
>       item1
>       option2
>       part3
>       section4
>
> parts of the string easily?
>
> I'd assume there could just be one regex statement where you could just 
change the number(s) to get data from first / to second /; data from second 
/ to third /, etc.
>
> Any ideas?
>
> Thanks
>
> Robert B. Harrison
> Director of Interactive Services
> Austin&  Williams
> 125 Kennedy Drive, Suite 100
> Hauppauge NY 11788
> P : 631.231.6600 Ext. 119
> F : 631.434.7022
> http://www.austin-williams.com
>
> Great advertising can't be either/or.  It must be&.
>
> Plug in to our blog: A&W Unplugged
> http://www.austin-williams.com/unplugged
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339760
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to