I need to get the first word after slash in a url in javascript, I assume using a regex would be ideal.
Here\'s an idea of what the URLs can possibly look like :
Non-regex.
var link = document.location.href.split('/'); alert(link[3]);