init(_:as:)
Creates a capture for the given component using the specified reference.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
init<W>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W)
Creates a capture for the given component using the specified reference.
init<W>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W)
s12RegexBuilder7CaptureV_2asACySs_qd__tGqd_0__AA9ReferenceVyqd__GtcSs_qd__tRsz0A6OutputQyd_0_Rsd__17_StringProcessing0A9ComponentRd_0_r0_lufc
What are these?82C2J
import RegexBuilder
struct Capture<Output>
A regex component that saves the matched substring, or a transformed result, for access in a regex match.
protocol RegexComponent<RegexOutput>
A type that represents a regular expression.
struct Reference<Capture>
A reference to a captured portion of a regular expression.
@frozen struct Substring
A slice of a string.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7, C8>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7, C8>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5)
Creates a capture for the given component.
init<W, C1, C2, C3, C4>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4)
Creates a capture for the given component.
init<W, C1, C2, C3, C4>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4)
Creates a capture for the given component.
init<W, C1, C2, C3>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2, C3)
Creates a capture for the given component.
init<W, C1, C2, C3>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3)
Creates a capture for the given component.
init<W, C1, C2>(_ component: some RegexComponent) where Output == (Substring, W, C1, C2)
Creates a capture for the given component.
init<W, C1, C2>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2)
Creates a capture for the given component.
init<W, C1>(_ component: some RegexComponent) where Output == (Substring, W, C1)
Creates a capture for the given component.
init<W, C1>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1)
Creates a capture for the given component.
init<W>(_ component: some RegexComponent) where Output == (Substring, W)
Creates a capture for the given component.
init<W>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W)
Creates a capture for the given component.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component using the specified reference.
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)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6, C7, C8>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6, C7>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4, C5)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3, C4)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2, C3)
Creates a capture for the given component using the specified reference.
init<W, C1, C2>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1, C2)
Creates a capture for the given component using the specified reference.
init<W, C1>(_ component: some RegexComponent, as reference: Reference<W>) where Output == (Substring, W, C1)
Creates a capture for the given component using the specified reference.
init<W, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, NewCapture>(_ component: some RegexComponent, as reference: Reference<NewCapture>, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture)
Creates a capture for the given component, transforming with the given closure.
init<W, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, NewCapture>(_ component: some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, NewCapture>(@RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6, C7, C8>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6, C7>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5, C6>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4, C5>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4, C5)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3, C4>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3, C4)
Creates a capture for the given component using the specified reference.
init<W, C1, C2, C3>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2, C3)
Creates a capture for the given component using the specified reference.
init<W, C1, C2>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1, C2)
Creates a capture for the given component using the specified reference.
init<W, C1>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1)
Creates a capture for the given component using the specified reference.
init<W>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W)
Creates a capture for the given component using the specified reference.
init<W, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8)
Creates a capture for the given component using the specified reference, transforming with the given closure.
init<W, C1, C2, C3, C4, C5, C6, C7, C8, C9, NewCapture>(as reference: Reference<NewCapture>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent, transform: @escaping (W) throws -> NewCapture) where Output == (Substring, NewCapture, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a capture for the given component using the specified reference, transforming with the given closure.
var regex: Regex<Output>