I think the question title seems to explain eveything. I want to detect whether a string is in URL format or not using javascript.
Any help appreciated.
try something like this:
function isUrl(s) { var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)? (\/|\/([\w#!:.?+=&%@!\-\/]))?/ return regexp.test(s); }