Regular Expression to Match All Characters after another Regex Match

Posted by Anthony Wood on Stack Overflow See other posts from Stack Overflow or by Anthony Wood
Published on 2012-12-17T23:24:00Z Indexed on 2012/12/18 5:03 UTC
Read the original article Hit count: 158

Filed under:
|

I know this may sound a little confusing, so I am open to suggestions on renaming the title.

Basically I have string such as C:...\Downloads\Folder\SubFolder\SubSubFolder. and I want to return the SubFolder and SubSubFolder only.

So far, my Regex looks like (?=\\Downloads\\.*?\\).* which matches Downloads\Folder\SubFolder\SubSubFolder.

Does anybody have any Ideas what I am missing????

All the solutions below seem to work (except if you didn't know "Folder"). Potentially a bug with the tool I was using to test the regular expressions.

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex