public native boolean isValidUrl(String url) /*-{ var pattern = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; return pattern.test(url); }-*/;
when url is only http://www then also it's display valid ....and also same for any string after "http://www.g" etc..
try this pattern: http(s)?:\/\/([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
when url is only http://www then also it's display valid ....and also same for any string after "http://www.g" etc..
ReplyDeletetry this pattern: http(s)?:\/\/([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
ReplyDelete