Java tutorial
//package com.java2s; public class Main { public static final boolean isIconUrl(String str) { if (isBlank(str)) { return false; } return str.matches( "((http|https|ftp|rtsp|mms):(\\/\\/|\\\\\\\\){1}((\\w)+[.]){1,}(net|com|cn|org|cc|tv|[0-9]{1,3})(\\S*\\/)((\\S)+[.]{1}(gif|jpg|png|bmp)))"); } private static boolean isBlank(String str) { if (str == null || str.matches("[ ]{0,}")) { return true; } return false; } }