Skip to content

Instantly share code, notes, and snippets.

@hamishhossack
Created July 27, 2015 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamishhossack/edef7cdee09fc2c37dfa to your computer and use it in GitHub Desktop.
Save hamishhossack/edef7cdee09fc2c37dfa to your computer and use it in GitHub Desktop.
isUrl Test
var isURL = function isUrl(s) {
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
console.info('Is URL ? ', regexp.test(s));
return regexp.test(s);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment