---
title: "subscript(_:)"
framework: swift
role: symbol
role_heading: Instance Subscript
path: "swift/regex/match/subscript(_:)-9bzv4"
---

# subscript(_:)

Accesses the capture with the specified name, if a capture with that name exists.

## Declaration

```swift
subscript(name: String) -> AnyRegexOutput.Element? { get }
```

## Parameters

- `name`: The name of the capture to access.

## Return Value

Return Value An element providing information about the capture, if there is a capture named name; otherwise, nil.
