title: Regex for replace page number in URL
body: <p>I'm not good with regex and I'm not able to figure out an applicable solution, so after a good amount of searching I'm still unable to nail this.</p>
  
  <p>I have an URL with an optional page=123 parameter. There can be other optional get parameters in the url too which can occur before or after the page parameter.</p>
  
  <p>I need to replace that parameter to page=--PLACEHOLDER-- to be able to use it with my paging function.</p>
  
  <p>If the page parameter does not occur in the url, I would like to add it the way described before.</p>
  
  <p>I'm trying to write an extension method for on string for this, but a static function would be just as good.</p>
  
  <p>A bit of explanation would be appreciated too, as it would give me a good lesson in regex and hopefully next time I wouldn't have to ask.</p>
  
  <p>Also I'm using asp.net mvc-3 but for compatibility reasons a complex rewrite occurs before the mvc-s routing, and I'm not able to access that. So please don't advise me to use mvc-s routing for this because I cant.</p>