コードコピーは次のとおりです。
public static string gethost(string url){
if(url == null || url.trim()。equals( "")){
戻る "";
}
文字列host = "";
パターンP = pattern.compile( "(?<= // |)((// w)+//。)+// w+");
matcher matcher = p.matcher(url);
if(matcher.find()){
host = matcher.group();
}
ホストを返します。
}