used by xx_go.sh to match shortest dir pattern