Here you can find the source of IsUrl(String str)
public static boolean IsUrl(String str)
//package com.java2s; //License from project: BSD License import java.util.regex.*; public class Main { public static boolean IsUrl(String str) { Pattern pattern = Pattern.compile("^[\\w]+://[\\w\\-\\.]+"); Matcher matcher = pattern.matcher(str); if (matcher.find()) { return true; }/*from ww w . j a va 2 s .c om*/ return false; } }