-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] backreferences in requirements regex #8139
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
Comments
As the first matching group is named, I guess the second one just starts with 1 not 2. |
Looks like valid regex. What's your PCRE version, @skydiablo? |
|
I found out why this doesn't work. The problem doesn't lie in the route matching, but in the URL generation. @skydiablo in the meantime you can set |
Thinking in more general terms, I come to the conslusion that supporting backreferences is impossible in the requirements check for URL generation. This is because the backreference is global for the whole regex but this check only tests against the single requirement. What might be possible is to use named backreferences instead. Then the position does not shift and it would work both for matching and generating urls. |
works great:
thx ! |
You are welcome. You can also use relative references which is maybe more appropriate: |
I renamed the title, so people could find this issue if they have similar problem. |
query parameter requirements regex:
this will end in this exception
thats right, but i have to use the referenz "\2", the routeMatcher need this behaivor
so what is to do ?
The text was updated successfully, but these errors were encountered: