Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Created February 7, 2010 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThisIsMissEm/297309 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/297309 to your computer and use it in GitHub Desktop.
var routes = {
"/t([a-zA-Z]+)": function(){}
}
var url = "/test";
for(var route in routes){
if(routes.hasOwnProperty(route) && (params = url.match(new RegExp(route))) ){
console.log("match", params);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment