Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
URL validator regex
function isUrl(s) {
var regexp = /((http|https):\/\/)?[A-Za-z0-9\.-]{3,}\.[A-Za-z]{2}/;
return s.indexOf(' ') < 0 && regexp.test(s);
}
isUrl('http://fatihacet.com.tr')
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.