Created
May 28, 2021 09:24
-
-
Save ashimon83/1f8edabb80a5099aba1b67e32584711c to your computer and use it in GitHub Desktop.
get url param from slashed url
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
// /path1/123/path2/345 | |
location.pathname.match(/\/path1\/([^\/]+)/) | |
// /path1/123 | |
location.pathname.match(/\/path2\/([^\/]+)/) | |
// /path2/345 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment