Skip to content

Instantly share code, notes, and snippets.

@c3ry5
Last active January 12, 2016 16: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 c3ry5/b02bdf2dabe57772839a to your computer and use it in GitHub Desktop.
Save c3ry5/b02bdf2dabe57772839a to your computer and use it in GitHub Desktop.
Url Validation
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