Last active
January 12, 2016 16:40
-
-
Save c3ry5/b02bdf2dabe57772839a to your computer and use it in GitHub Desktop.
Url Validation
This file contains hidden or 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 checkUrl = function(url) { | |
var regex = new RegExp("(https?://(?:www.|(?!www))[^s.]+.[^s]{2,}|www.[^s]+.[^s]{2,})"); | |
return url.match(regex) ? !0 : !1 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment