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, C1>(as reference: Reference<W>, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, W, C1)

Parameters

reference

The reference to use for anything captured by component.

componentBuilder

A builder closure that generates a regex component to capture.