<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/RegexBuilder/Capture/init(_:)-751s0",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RegexBuilder"
    ],
    "preciseIdentifier" : "s:12RegexBuilder7CaptureVyACySs_qd__tGqd_0_cSs_qd__tRsz0A6OutputQyd_0_Rsd__17_StringProcessing0A9ComponentRd_0_r0_lufc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Creates a capture for the given component.

```
init<W>(_ component: some RegexComponent) where Output == (Substring, W)
```

## Parameters

`component`

The regex component to capture.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)