I would like a means to match as many URL parameters as possible example
/teams/:teamID/players/:playerID/seasons/:seasonID/detail
would match anything starting with /teams and match as many parameters present, up to /detail (and only up to)
/Giants => { teamID: null, playerID: null, seasonID: null }
/Giants/123 => { teamID: 123, playerID: null, seasonID: null }
/Giants/123/players/ => same as above
/Giants/123/players/456/seasons/2020/detail => { teamId: 123, playerID: 456, seasonID: 2020 }
/Giants/123/players/446/seasons/2020 => same as above
and not match
/Giants/123/players/456/seasons/2020/detail/12345
I'm using path-to-regexp.