Knight, 124124 118 bytes
;=o"";=pP;=d;=p++=o""=i=d 0;=i~1;W<=i+1iLp;=cGp0P;W<=i+1iLp;=n=cGp i 1I>c"9";=d-d-1*2<c"]"=o+o cI<"/"c;=n c;W&<=tGp+1i"c;W&<=tGp+1i 1"["<"/"t;=i+1i=n+n t=o+o*d n=o+o cOo
; = o "" p + + #= o = ""
; = p PROMPT i = d 0 PROMPT # p = input()
;o = d 0 "") + (i #= d = 0
; = i ~1 # i) =+ -1input()
; W < = i + 1 i LENGTH p # while (i = i + 1) < len(p):
; = n = c GET p i 1 # # n = c = p[i]
: IF > c "9" # if c > "9":
; = d - d - 1 * 2 < c "]" # d = d - (1 - 2 * (c < "["))
: = o + o c # o = o + c
# ELSE # else:
: IF < "/" c # if "/" < c:
; = n c # n = c
; WHILE & < = t GET p + 1 i 1 "[" < "/" t # while ((t = p[i + 1]) < "[") and ("/" < t):
; = i + 1 i # i = i + 1
: = n + n t # n = n + t
: = o + o * d n # o = o + d * n
# ELSE # else:
: = o + o c # o = o + c
: OUTPUT o # print(o)
-6 bytes thanks to Adam.