CLARIFICATION: I am not asking for a pattern. I am asking why a pattern works in PHP and JavaScript but not in .Net.
I am trying to get the bottom level folder from a path. The pattern works in PHP and JavaScript but returns an unexpected result in .Net. I would like to understand why .Net returns what it returns with this pattern.
Given this path:
"c:\level0\level1\level2\filename.ext"
I am trying to match
"level2"
This is the pattern I am using: (editor keeps taking out the slashes, so here is a picture:
What I expect to match :
level2
What C# matches:
c:\level0\level1
For completeness, here is the pattern in the RegEx instance:
How does this pattern need to be specified for .Net to match the bottom level folder?