prefixMatch(of:)

Matches part of the regex, starting at the beginning, where the regex is created by the given closure.

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
func prefixMatch<Output>(@RegexComponentBuilder of content: () -> some RegexComponent) -> Regex<Output>.Match?

Parameters

content

A closure that returns a regex to match against.

Returns

The match if there is one, or nil if none.