Title might be confusing but essentially what I'm trying to do is explained below.
If I had a url /app/{var1}/foo for a given class controller
And now at this point I'd like to be able to have a single method that matches:
/bar/bar1/bar2 (where bar1 and bar2 are both optional i.e. it could be bar, bar/bar1 or bar/bar1/bar2)
I do also want a second method that could handle
/bar/X, /bar/bar1/X, bar/bar1/bar2/X (all to be captured and handled by the same method).
Any ideas how the regex here would go. I have the documentation for how to capture the rest of the URL i.e foo/**. But in my case I guess i'm looking to capture cases where the url may also end in a specific way without certainty of the depth.