How JS regular expressions validate "folder A / folder B / folder C..."

are there any js regular expression experts?
would like to ask how to implement regular expression validation "folder A / folder B / folder C..." Or folder A, where
1 is satisfied. Cannot start and end with "/",
2. You cannot have more than two consecutive "/" in the middle.
wrote a ^ < sup id= "fnref-1" > 1 < / sup > (?: (! / /) [S]) * < sup id= "fnref-2" > 2 < / sup > $is found to basically meet the requirements,
but the check fails
when entering a string, such as "a", so ask the bosses if they have a better solution, regardless of the special string

. < hr >
    < li id= "fn-1" > / rooms < li id= "fn-2" > / rooms

/^(?!(\/|.*\/$|.*\/\/))/

^ (?: [^\ /] +\ /?) + [^\ /] $


^[^\/]+(?:\/[^\/]+)*$
Menu