Javascript: URL Validation

Javascript: url validating function


function isUrl(s) {
	var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
	return regexp.test(s);
}

usage:

if (isUrl("http://www.page.com")) 
   alert("correct")
else 
   alert("not correct");