Javascript: URL Validation

Javascript: url validating function

[code language="javascript"]

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

[/code]

usage:
[code language="javascript"]
if (isUrl("http://www.page.com"))
alert("is correct")
else
alert("not correct");
[/code]