Created
September 21, 2019 08:27
-
-
Save anteeek/28e3dbe95b324e4629360526b5171638 to your computer and use it in GitHub Desktop.
Capture all params by a regex from a express route string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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