You will want to use the first output of fileparts as it is guaranteed to work on all platforms. The fileparts function is a built-in designed to separate a path into it's directory, filename, and file extension.
string = '/disk1/home/alb/main/directory1/image0001.png'
part = fileparts(string);
If you really need that trailing slash (you shouldn't if you use fullfile to (correctly) construct a new path), then you can add it to the end using filesep.
part_with_slash = [part, filesep];
If for some reason you are trying to process this *nix file path on a Windows machine (which has a different file separator), Only then you could use the following regexp.
part = regexp(string, '.*/', 'match');