alert("http://javascript.ru/forum/search.php?searchid=332323".replace(/(^http[s]?:\/\/.*?)([a-z\-]+\.[a-z]+)(\/.*?$)/i, "$1$3"));
alert("http://javascript.ru/forum/search.php?searchid=332323".match(/(^http[s]?:\/\/.*?)(?:[a-z\-]+\.[a-z]+)(\/.*?$)/i));