Page 1 of 1

Problem with regex to my url route

Posted: Mon Nov 09, 2009 2:45 pm
by Pepino483
Hi, i problem with regex to my url route.. I have URL

,,var?" may by one or X...

var11/var12/var13/b/var21/var22/var23/t/var31/var32/var33

but url can by only

var11/var12/var13/b/var21/var22/var23/

or

var11/var12/var13/

For example.. this is URL to eshop.. For viewing products in category's and in the url is brands filter and tag filter.. I can't change the char representing filter key..

I am function solution.. Writed route for every option format of url.. Can you help me find better solution please?

Re: Problem with regex to my url route

Posted: Mon Nov 09, 2009 9:15 pm
by josh
I... dont... understand....

Re: Problem with regex to my url route

Posted: Mon Nov 09, 2009 10:14 pm
by superdezign
Try giving us examples of your input and examples of the output from that input. Give us enough, and maybe we can determine what you are trying to do and help you mutate the input into the output.

Re: Problem with regex to my url route

Posted: Tue Nov 10, 2009 2:17 am
by Pepino483
oh.. i'am sorry for my bad english..

Input url may be
http://www.domain.com/shoes/sport/b/nike/asolo/t/news
or
http://www.domain.com/t-shirt/t/mens
or
http://www.domain.com/skirts/

I'am try match category as ([^bt]*) but problem come when category name is boots or anything else beginning with the letter b or t..

Re: Problem with regex to my url route

Posted: Tue Nov 10, 2009 7:13 am
by josh
Tell it to match a forward slash after that letter then.

For this I would really use an existing MVC framework, you wouldn't have to write regex for one.