A cópia do código é a seguinte:
public static string gethost (string url) {
if (url == null || url.trim (). igual ("")) {
retornar "";
}
String host = "";
Padrão p = padrão.compile ("(? <= // |) ((// w)+//.)+// w+");
Matcher Matcher = P.Matcher (URL);
if (matcher.find ()) {
host = matcher.group ();
}
host de retorno;
}