solve wildcard matching