Skip to content

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

@zilahir

Description

@zilahir

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions