One Logo Pool Ball
RegexBuilder · IOS API REFERENCE

ChoiceOf

struct · iOS 16.0+ · SDK 27.1

struct ChoiceOf<Output>

A regex component that chooses exactly one of its constituent regex components when matching. You can use `ChoiceOf` to provide a group of regex components, each of which can be exclusively matched. In this example, `regex` successfully matches either a `"CREDIT"` or `"DEBIT"` substring: let regex = Regex { ChoiceOf { "CREDIT" "DEBIT" } } let match = try regex.prefixMatch(in: "DEBIT 04032020 Payroll $69.73") print(match?.0 as Any) // Prints "DEBIT"

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

ChoiceOf.init(_:)

callback cannot propagate synchronous failure

All RegexBuilder types →