title: How do I use a regex to replace an Id in the middle of a Url?
body: <p>I need a Regex or any other solution to replace an id in the middle of a Url (not in querystring).</p>
  
  <p>Url example:</p>
  
  <pre><code>http://localhost:1876/category/6?sortBy=asc&amp;orderBy=Popular
  </code></pre>
  
  <p>I want to replace - <em>category/6</em> with <em>category/anotherID</em>. </p>
  
  <p>The routing thats being used is: </p>
  
  <pre><code>routes.MapRoute(
        "categories",
        "category/{categoryID}/{categoryName}",
        new { controller = "Search", action = "SearchResults", categoryID = "", categoryName = "" }
  );
  </code></pre>
  
  <p>thanks</p>