RegexOutput
The output type for this regular expression.
Declaration
associatedtype RegexOutputDiscussion
A Regex instance’s output type depends on whether the Regex has captures and how it is created.
A
Regexcreated from a string using theinit(_:)initializer has an output type of AnyRegexOutput, whether it has captures or not.A
Regexwithout captures created from a regex literal, theinit(_:as:)initializer, or aRegexBuilderclosure has aSubstringoutput type, where the substring is the portion of the string that was matched.A
Regexwith captures created from a regex literal or theinit(_:as:)initializer has a tuple of substrings as its output type. The first component of the tuple is the full portion of the string that was matched, with the remaining components holding the captures.