Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to create pattern for unlimited amount of url parameters? #57

Open
zilahir opened this issue Oct 20, 2020 · 0 comments
Open

how to create pattern for unlimited amount of url parameters? #57

zilahir opened this issue Oct 20, 2020 · 0 comments

Comments

@zilahir
Copy link

zilahir commented Oct 20, 2020

It's probably on me, but I was unable to create a pattern for url's like this:

<url>/present/tag1/tag2/tag3/[...tagN]

the <url>/present is a const, the tags are coming at the end of it.

This is what Ive been trying with:

new UrlPattern(/^\/present\/(.*)$/);

but then result is:

["1-lorem/5-ipsum"]

which is an array, with a single item.

Now i could split it by / but then the usage of url-pattern becomes quite unnecessary, so I'd rather solve it using the corerct way.

What i am aiming for is something like this:

["1-lorem", "2-ipsum"]

Any help is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant