I want to return this from a function that gives Regex<Substring> on all other code paths, but this is Regex<(Substring, Substring)>. I thought I could be clever and add transform: { _ in } to the capture, but that just makes it Regex<(Substring, Void)>. Is it possible to erase the capture group from the type of the regex and have its output only report the full match, or do I have to rewrite the function's callers to work with Regex<AnyRegexOutput>? (If the latter, I'll also have to modify all the other code paths, because instead of just .init { ... } they'll have to say .init(Regex { ... }).)
Yes, mapOutput is what you want. It didn't make the initial release, but we're working on it currently.
In the mean time, you can use the existential AnyRegexOutput as you mentioned. You might also be able to make some of your functions generic over the capture types.