Closed dominictarr closed 13 years ago
a * is substituted for the regex (.+)
. when you have /aaa%Fbb%Fcc/uuuu
, and the route '/'', it will match the *first part of the string (and as much of the string as possible) that fits \/(.+)
.
If i understood some more examples, I could give you better help.
route:'/:first/*'
would evaluate to params: {first:"aaa%Fbb%Fcc"}, splats["uuuuu"]
.
If you generate more examples and what you want the desired behavior to be, I'll help you with the routing. For now, this is working as designed so I will close the issue.
thanks, that is helpful. so what is happening is the (.+) is catching everything, if I put more ///*/ after it would work, but what I'm trying to do is catch an arbitrary number url splats. but routes does not work recursively.
basicially I wanted to /split/every/slash-separated/section/into/splats
{
splats: ["split","every","slash-separated","section","into","splats"]
}
but I can see now that will not fit well into the routes api.
thanks!
ah, yes. this would be better with just using '/split/every/slash-separated/section/into/splats'.split("/")
yeah, I'm looking for a router that makes sense on the commandline and on the url, but you can do:
ls *
on the cli, which will be expanded by the shell, and ls will see a list or args, but you never get urls like that...
hey, suppose that I want to parse some thing like this:
"/aaa%2Fbb%2Fcc/uuuuu"
if I use a route like: "/*" i get:
I was kinda expecting
what do you think, is this reasonable behavior?
and can you point me to where I might start fixing this?
by the way, I want to use this to parse CLI commands. i'm passing them through: