Multi-dimensional pattern matching with dimensional wildcards: Data structures and optimal on-line search algorithms