[Accepted with modifications] SE-0357: Regex String Processing Algorithms

Hi everyone. The review of SE-0357: Regex String Processing Algorithms has concluded and the proposal has been accepted with modifications.

The proposal was received favorably. The only major area of discussion was regarding the behavior of ~= and whether it should perform a full or partial match. Since a clear decision was not reached, the authors proposed, and the language work group agreed, to remove the operator from the proposal for now, allowing for more discussion post-Swift 5.7. Additionally, they would like to investigate the possibility of using named captures to effect bindings in case statements in the future, which may affect the implementation.

Thank you to everyone who participated in both the review.

Ben Cohen
Review Manager

12 Likes

Typo alert: this is about SE-0357, not SE-0354.

3 Likes

Fixed, thank you.

2 Likes

This "accepted with modification" issue was recently brought to my attention when trying to use the regex literal swift case syntax (which depends on ~=) as shown in WWDC22 presentations. See StackoverFlow "How to use Swift literal regex expressions in switch case pattern statements?" .

Is there a place where any future regex behavior of ~= continues to be discussed and evaluated? Thanks.

There has been no further discussion of ~= for Regex at this point. It would begin with a pitch in the evolution section; such a pitch should focus primarily on laying out a clear rationale for why it is proposing either partial or whole match semantics for this operation (or something else), with a set of examples to argue that the proposed semantics are better than alternatives.