Updated the route matching so it can use more complex patterns