wildcard matching: less memory