swiftlang / swift-experimental-string-processing

An early experimental general-purpose pattern matching engine for Swift.
Apache License 2.0
278 stars 47 forks source link

Creating a `ChoiceOf` from an array #701

Open bbrk24 opened 11 months ago

bbrk24 commented 11 months ago

Relevant forums thread: https://forums.swift.org/t/creating-a-regex-choiceof-from-an-array/68755

I don't mind whether this is ChoiceOf.init<T: Collection<Substring>>(_ arr: T) or AlternationBuilder.buildArray<R: RegexComponent<Substring>>(_ components: [R]), but it should be possible to create a ChoiceOf from a collection.

tomabuct commented 10 months ago

+1