MCPcopy Create free account
hub / github.com/c0ny1/captcha-killer / isURL

Method isURL

src/main/java/utils/Util.java:162–177  ·  view source on GitHub ↗
(String url)

Source from the content-addressed store, hash-verified

160 }
161
162 public static boolean isURL(String url){
163 if (url == null ){
164 return false ;
165 }
166 String regEx = "^(http|https|ftp)\\://([a-zA-Z0-9\\.\\-]+(\\:[a-zA-"
167 + "Z0-9\\.&%\\$\\-]+)*@)?((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{"
168 + "2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}"
169 + "[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|"
170 + "[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-"
171 + "4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0"
172 + "-9\\-]+\\.)*[a-zA-Z0-9\\-]+\\.[a-zA-Z]{2,4})(\\:[0-9]+)?(/"
173 + "[^/][a-zA-Z0-9\\.\\,\\?\\'\\\\/\\+&%\\$\\=~_\\-@]*)*$" ;
174 Pattern p = Pattern.compile(regEx);
175 Matcher matcher = p.matcher(url);
176 return matcher.matches();
177 }
178
179 /**
180 * 转义正则特殊字符 $()*+.[]?\^{},|

Callers 5

parserRequestMethod · 0.95
parserRequestOldMethod · 0.95
requestImageMethod · 0.95
doInBackgroundMethod · 0.95
actionPerformedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected