How to implement js regular expression validation "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. Cannot have more than two consecutive "/" in the middle,
3. You can write a ^ [^\ /] (?: (?) before you ignore the special string
. \ /\ /) [\ S]) * [^\ /] $
found that the requirements are basically met,
but the check fails
when entering a string, such as "a", so ask the bosses if they have a better solution?


^ [^\ /] + (\ / [^\ /] +) * $


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

^ (w) (/ w) {0Magne2}

Menu