generate wildcard patterns from words