---
title: "init(_:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/regex/init(_:)-92siq"
---

# init(_:)

Creates a regular expression with a dynamic capture list from the given regular expression.

## Declaration

```swift
init<OtherOutput>(_ regex: Regex<OtherOutput>)
```

## Parameters

- `regex`: A regular expression to convert to use a dynamic capture list.

## Discussion

Discussion You can use this initializer to convert a Regex with strongly-typed captures into a Regex with AnyRegexOutput as its output type.
