SitePoint Sponsor |
|
User Tag List
Results 1 to 1 of 1
Thread: Regular Expression question
-
Jan 30, 2007, 13:05 #1
Regular Expression question
hello guys,
this is what I'm trying to accomplish:
I have a search engine friendly URL like this:
http://www.somesite.com/restaurants--reviews-compare-prices/Std_Country~Belgium/Restaurants_Cuisine~African/browsecat-1
by applying the following pattern:
^http://www.somesite.com/.*(/([a-zA-Z0-9_]+)~(.*))+/browsecat-([0-9]+)$
I'm trying to change the SEF url to this:
http://www.somesite.com/browsecat.asp?CatID=1&Std_Country=Belgium&Restaurants_Cuisine=African
by using code like this:
regex.replace(SEFURL,"browsecat.asp?CatID=$4&$2=$3")
however, all I'm getting is this:
http://www.somesite.com/browsecat.asp?CatID=1&Restaurants_Cuisine=African
which is only partially right. does anyone know how can I get this thing right? thank you very much in advanceLast edited by Alchemist; Jan 30, 2007 at 13:06. Reason: posting mistake
Bookmarks