title: Removing string from string where part of the string can be a number in javascript
body: <p>I want to remove part of a string from another string where the part I want to remove has a number in it.</p>
  
  <p>The string is my url and the part I want to remove is the page and page number
  ex.</p>
  
  <pre><code>var url = www.mysite.com/?someparam=someparam&amp;someparam=somparam&amp;page=3
  </code></pre>
  
  <p>I want to remove the</p>
  
  <pre><code>&amp;page=3
  </code></pre>
  
  <p>but the page can be 1,2,3,4,etc</p>
  
  <p>I know I can do this by string replace like</p>
  
  <pre><code>var str = "mystring&amp;page=1";
  var res = str.replace("&amp;page=1", "");
  </code></pre>
  
  <p>but this only works with a static number like 1, and I want it to work with any number</p>