# `GSFont expandWildcardsInNameList:contextLabel:error:`

*Instance Method*

Expands name queries into a set of local glyph names.

## Declaration

```swift
func expandWildcards(inNameList nameList: [String], contextLabel: String) throws -> Set<String>
```

```objc
- (NSSet<NSString *> *) expandWildcardsInNameList:(NSArray<NSString *> *) nameList contextLabel:(NSString *) contextLabel error:(NSError **) error;
```

```python
expandWildcardsInNameList_contextLabel_error_(nameList: list[str], contextLabel: str) -> tuple[set[str], NSError]
```

## Parameters

- `nameList` — Literal glyph names and name queries to expand.
- `contextLabel` — A description of the queries’ source for use in errors.
- `error` — On output, a pointer to an error object that describes why the method failed, or `nil` if no error occurred. If you are not interested in the error information, pass `nil` for this parameter.

## Discussion

Duplicate matches are removed and the order of the names is not preserved.

## See Also

### Glyph Name Queries

- [`GSFont glyphNamesForWildcard:contextLabel:error:`](/Core/GlyphsCore/GSFont/glyphNamesForWildcard:contextLabel:error:) — Returns the local glyph names matching a name query.
- [`GSFont baseName:forWildCard:`](/Core/GlyphsCore/GSFont/baseName:forWildCard:) — Returns the part of a matching glyph name represented by `*` in a name pattern, or `nil` when the pattern does not contain `*` or the glyph name is shorter than the pattern.
- [`GSFont prepareName2Glyph`](/Core/GlyphsCore/GSFont/prepareName2Glyph) — Rebuilds the cache that maps local glyph names to glyphs.

