You actually can, **/ is shorthand for (*/)# although the latter only works with extended_glob enabled, the shorthand always works. You can use any pattern in place of the * if you want (for example, (^(a|b|c)/)# which would exclude a, b or c from any segment being recursed), although in the case above I think you'd have actually wanted /^(proc|sys)/**/etc/r* if the problem was not another typo.
% print -l /^(proc|sys)/**/etc/rc*(/N)
... nothing
% print -l /^(proc|sys)/**/etc/rc*
/aWorking/Changed/etc/rc.local
... but that's a file not a directory.
0 /etc 0 % print -l /(*/)#etc/rc*(/N)
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d
... but that took 37 seconds! Trying the 'normal' way:
0 /etc 0 % print -l /**/etc/rc*(/N)
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d
.... that took 3 seconds! Not exactly six of one half a dozen of
the other, tho the output is correct.
Going back to 'your way' but swapping out the asterisk as you say:
0 /etc 0 % print -l /(^(proc|sys)/)#etc/rc*(/N)
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d
... 7 seconds! Don't know what to make of it. It seems very
happy not to have to search in proc and sys OTOH it's still twice
as long as the 'regular' syntax. Leaves me scratchin' my head.
Since I no longer have to worry about the /proc disaster, as Bart
rescued me, the only issue now would be performance, and if
skipping proc and sys would help with that, fine, but as we see it
seems to backfire. Matter of curiosity only! Nothing broken,
still one might wonder at these changes in performance. I tend to
think of syntax variations as all ending up as the same thing
under the hood, but maybe not. As to proc and sys, my guess would
have been that skipping them would make very little difference
since they aren't real directories anyway, and yet it makes 5X
difference. Another loop of some sort? Sorta like my /proc
disaster but perhaps resolving itself somehow?