Generic route pattern matching