Group paths by glob pattern of directories