Created
July 27, 2015 14:40
-
-
Save hamishhossack/edef7cdee09fc2c37dfa to your computer and use it in GitHub Desktop.
isUrl Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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