extract dimensionality from dimension names