in reply to regex on path

you'll want to consider something like

m!^/(.*?)/!
and also to read some of the resources listed here.
--au