---
title: "init(_:as:)"
framework: regexbuilder
role: symbol
role_heading: Initializer
path: "regexbuilder/capture/init(_:as:)-6w075"
---

# init(_:as:)

Creates a capture for the given component using the specified reference.

## Declaration

```swift
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9)
```

## Parameters

- `component`: The regex component to capture.
- `reference`: The reference to use for anything captured by component.
