Skip to content

Instantly share code, notes, and snippets.

@allomov
Created August 21, 2018 08:46
Show Gist options
  • Save allomov/e112bd358232d1591147f43085a7b6df to your computer and use it in GitHub Desktop.
Save allomov/e112bd358232d1591147f43085a7b6df to your computer and use it in GitHub Desktop.
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