<!--
{
  "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/RegexComponentBuilder",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "RegexBuilder"
    ],
    "preciseIdentifier" : "s:12RegexBuilder0a9ComponentB0O"
  },
  "title" : "RegexComponentBuilder"
}
-->

# RegexComponentBuilder

A custom parameter attribute that constructs regular expressions from
closures.

```
@resultBuilder enum RegexComponentBuilder
```

## Overview

You typically see `RegexComponentBuilder` as a parameter attribute for
`Regex`- or `RegexComponent`-producing closure parameters, allowing those
closures to combine multiple regular expression components. Type
initializers and string algorithm methods in the RegexBuilder framework
include a builder closure parameter, so that you can use regular expression
components together.

---

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)