title: Remove specific parameter from url using jquery or javascript
body: <p>The url is something like this</p>
  
  <pre><code>../search/days=4&amp;people=4&amp;stars[]=1&amp;stars[]=2
  </code></pre>
  
  <p>I want to remove the parameter stars[] which is multiple in my case. I tried using below script but it is removing only 1 instance of the parameter but not all.</p>
  
  <pre><code>var onlyUrl = window.location.href.replace(/&amp;stars\[\]=\d+/, '');
  </code></pre>
  
  <p>Short &amp; sweet solution is appreciated. Thank you in advance.</p>