.match(/^http[s]?:\/\/.*?([a-z\-]+\.[a-z]+)\/.*?$/i);
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));
.match(/(^http[s]?:\/\/.*?)(W.*?$)/i);