SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Evangelist Alchemist's Avatar
    Join Date
    Aug 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 advance
    Last edited by Alchemist; Jan 30, 2007 at 12:06. Reason: posting mistake


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •