mjijackson/strata — Issue #19: Router Signature
Author: bingomanatee
Created: 2011-11-29 04:26:15+00:00
State: open

I recommend adding '.' to the exclusion lists;

function compileRoute(route, keys) {
var pattern = route.replace(/((:[a-z_$][a-z0-9_$]*)|[*.+()])/ig, function (match) {
switch (match) {
case "*":
keys.push("splat");
return "(.*?)";
case ".":
case "+":
case "(":
case ")":
return utils.escapeRe(match);
}

keys.push(match.substring(1));

return "([^./?#]+)";
});

return new RegExp("^" + pattern + "$");
}

a very common pattern '/foo/:id\.:format' kind of requires it