Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.