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 use () in Custom Match Parameters? #211

Closed
doubleKGe opened this issue Nov 26, 2019 · 2 comments
Closed

How to use () in Custom Match Parameters? #211

doubleKGe opened this issue Nov 26, 2019 · 2 comments

Comments

@doubleKGe
Copy link

For example:
If I write it like this:

path: ':code([^\/]+?/[^\/]+?/[^\/]+?)?'

It's true
but If I write it like this:

path: ':code(([^\/]+?)/([^\/]+?)/([^\/]+?))?'

It will not live up to expectations

So I want to ask how to use () in Custom Match Parameters?

@blakeembrey
Copy link
Member

It should throw an error telling you what you need to do. It needs to be non-capturing. Here’s an example I found online for non-capturing groups: https://javascript.info/regexp-groups#non-capturing-groups-with

@blakeembrey
Copy link
Member

This is also only allowed in V3 or higher.

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

2 participants