Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active August 29, 2015 14:25
Embed
What would you like to do?
get name repository from url github
//get name github url from javascript
var repo_url = "http://github.com/frontend-labs/flux"; //obtain => flux
var name = repo_url.replace(/http(?:s|)\:\/\/(?:www\.|)github\.com\/(?:.*?)\/(.*?)/, "$1")
console.log(name); // flux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment