Regex remove last folder from path
Replace
[^\\]+\\?$
by nothing. This works for paths like C:\Temp\Dir1
(no trailing backslash) as well. It fails for the root directory of a drive.
Replace
[^\\]+\\?$
by nothing. This works for paths like C:\Temp\Dir1
(no trailing backslash) as well. It fails for the root directory of a drive.