mtrpcic/pathjs — Issue #17: Dynamic url matching is inconsistent
Author: geuis
Created: 2012-02-25 04:25:17+00:00
State: open

Running into a strange problem trying to match certain url patterns

Path.map('/test(/:id1)(/:id2)(/:id3)(/:id4)(/:id5)').to(function(){
console.log( this.params );
});
Path.history.listen(true);

If I do a pushState of a pattern of /test/0/0/0 it works.

However, /test/0/1/0 doesn't.

If I do /test/0/a/0 it also works.

I'm having to use multiple :id values because there's a nested array returned from an XHR request when the app initializes and the url structure is the pattern of indexes used to reach into the array to obtain data.

On a side note, being able to do some more advanced regex-style url matching would be *very* useful. What I have in mind is the route matching that's used in the node.js Express framework.