I want to validate urls. It should accept:
http://google.com http://www.google.com www.google.com google.com
I refer Regex to match URL
function isUrl(s) { var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ return regexp.test(s); }