Unable to combine named regexes with trailing wildcards #6

yellincmp opened this Issue Jun 4, 2013 · 2 comments


None yet

2 participants


Perhaps this is intentional, or perhaps I have just misunderstood how to use the route class, but it seems that when combining named regexes with trailing wildcards, Route::wildcardArgs() does not return the correct values.

For example, for:


with route /testController/testAction/words/extra/fields :

//returns array('words')

If I change route to:

//returns array('extra', 'fields'), as intended.
deceze commented Jun 5, 2013

Good point. This is due to the way URLs are matched internally. It constructs one long regular expression to match against the URL, with wildcards being captured by a capture group. In your pattern, you are adding a capturing group yourself, which messes this process up. It should work (not tested) if you change your pattern to a non-capturing group:


This is a case which the readme warns against as non-trivial regexen... :)

deceze commented Jun 7, 2013

I committed a change that should allow grouping expressions together with wildcards.
Thanks for the report!

@deceze deceze closed this Jun 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment