ok, so i was looking for a straight-out answer to your question, then figured it out myself, and figured i might as well post it...
So, without further ado:
replaced by $1
will strip anything other then the bla.bla before the / in any url, reliable as hell.
Oh, since you're using php; don't forget the starting and ending thing so like:
preg_replace('@(?:.+://)?(?:[^/]*\.)?([^/]+\.[^/]+)(?:/?.*)?@', '$1', $url);
(PS. if you do happen to find some way to beat it, please inform me