Java tutorial
//package com.java2s; public class Main { public static boolean hasHost(String link) { return link.matches("https?\\:\\/\\/([a-z0-9-.]*)\\.([a-z]{2,5})"); } }