I am trying to match the folder name in a relative path using C#. I am using the expression: "/(.*)?/"
and reversing the matching from left to right to right to left.
When I pass "images/gringo/"
into the regular expression, it correctly gives me "gringo"
in the first group - I'm only interested in what is between the brackets.
When I pass in "images/"
, it fails to pick up "images"
.
I have tried using [/^]
and [/$]
but neither work.
Thanks, David