Skip to content

Instantly share code, notes, and snippets.

@anteeek
Created September 21, 2019 08:27
Show Gist options
  • Save anteeek/28e3dbe95b324e4629360526b5171638 to your computer and use it in GitHub Desktop.
Save anteeek/28e3dbe95b324e4629360526b5171638 to your computer and use it in GitHub Desktop.
Capture all params by a regex from a express route string
const route = "/first/:second/:third/fourth/:fifth"
// (3) ["second", "third", "fifth"]
route.match(/(?<=\/:)(.*?(?=\/))/g);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment