another maybe correct solution for wildcard matching.