---
title: "init(_:)"
framework: regexbuilder
role: symbol
role_heading: Initializer
path: "regexbuilder/capture/init(_:)-3o4p2"
---

# init(_:)

Creates a capture for the given component.

## Declaration

```swift
init<W>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W)
```

## Parameters

- `componentBuilder`: A builder closure that generates a regex component to capture.
