Regular expressions by themselves simply match something; they don't "extract". You can use them to identify strings which match a particular pattern; for example, whether the input has at least two slashes, and a string of non-slashes between those two slashes. However, the regular expression by itself does not as such allow you to extract part of the match (in the example, the string between the slashes). That's why you keep receiving replies which involve some sort of code -- it depends on the capabilities of the tool you use how you would use the regular expressions to extract any part of the match (in this thread as well as
your original thread).
Thanks for the pointer to the Jakarta regex demo; the fact that you are using this makes a world of a difference.
If that tool allows for extracting a parenthesized subexpression, then your second problem can be solved, but the regular expression needs to look at (and, by extension, "extract") most or all of the context to know whether a particular slash is the last one in the test string.
So you can use
/([^/]*)/[^/]*$ to tell whether there are two slashes before the end of the string, and if that is so, then the first parenthesized subexpression (
$1 or
\1 in many regex tools) will contain the parenthesized part between the slashes; but there is no way to construct a regular expression which alone picks out just the text between those two specific slashes. (The parentheses by themselves do not add anything to the regular expression, in this case; they are useful here only because of the side effect of capturing a substring of the match.)
If you relax the requirement (perhaps because none of your examples contain more than two slashes) then you can match (and "extract") a string between two slashes, but without reference to context, the regex engine will pick the first place in the string where it finds text between two slashes.
It appears that in all your examples, the first string between two slashes which is longer than three characters and which does not begin with a number is the parent directory; thus
[^/0-9][^/][^/][^/][^/]* will coincidentally pick out that, but relying on this to work on a larger number of samples appears most precarious.