permute and expand glob-like text patterns