Would be nice to compare it to www.confreaks.com/videos/782-magrails2011-pattern-matching
Hi,
The code referred to in that presentation is the rails router, journey - https://github.com/rails/journey
router.lua is much simpler than that. Journey can parse complex regular expressions like `/(app|application)/(:id)+/foo` while router.lua can only handle parameter interpolations (like `/app/:app_id/foo`). We found out that handling parameters was enough for us.
That said, the strategy we use is pretty similar: we parse the routes and transform them into a tree, which then allows us to match urls faster. It's just that our string parsing and tree construction are much, much simpler than Journey's.