Multi-dimensional pattern matching with dimensional wildcards