Optional URL segments

I have a drilldown page in which I can drill down 3 levels exactly, always.

I want my URL to look like this:
drill - main page
drill/:l1 - drill down to l1
drill/:l1/l2 - drill down to l1 then to l2
drill/:l1/:l2/:l3 - drill down to l1, then to l2, then to l3.

All of them function the same, with just different data, and currently I use $ to separate them, like drill/l1$l2$l3 and know which level by the $ sign.

Is there a way to make it an optional segment of drill/:l1?/:l2?/:l3? ?