Remove a param from URL using Javascript
<p>I am using this function that works great to add and edit params</p>

<pre><code>function addOrUpdateUrlParam(name, value)
{
    var href = window.location.href;
    var regex = new RegExp("[&amp;\\?]" + name + "=");
    if(regex.test(href))
    {
       regex = new RegExp("([&amp;\\?])" + name + "=\\d+");
       window.location.href = href.replace(regex, "$1" + name + "=" +  value);
    }
    else
    {
       if(href.indexOf("?") &gt; -1)
             window.location.href = href + "&amp;" + name + "=" + value;
       else
             window.location.href = href + "?" + name + "=" + value;
     }
}
</code></pre>

<p>how I can make a similar function to remove a param?, I don't understand regexp =(</p>

<p>thks</p>
