Skip to content

Instantly share code, notes, and snippets.

@allomov
Created August 21, 2018 08:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
var url = 'http://localhost:8081/api/v2/deliverable_builds/6db57828-01b5-11e8-a40f-685b358e6aa5'
var idExtractor = /([\d\w\-]+)$/g;
var idMatch = idExtractor.exec(url);
console.log(idMatch[1]);
var typeExtractor = /\/([\w\d\_]+)\/[\d\w\-]+$/g;
var typeMatch = typeExtractor.exec(url);
console.log(typeMatch[1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment