[swift-evolution] Empower String type with regular expression

Dany St-Amant dsa.mls at icloud.com
Sun Jan 31 14:46:33 CST 2016

This seem to be two proposals in one:
1. Initialize NSRegularExpression with a single String which includes options

The ultimate goal based on the earlier mail in the thread seems to be able in a future proposal do thing like: string ~= replacePattern, if string =~ pattern, decoupled from the legacy Obj-C. Isn’t NSRegularExpression part of the legacy? The conversion of the literal string as regular expression should probably part of the proposal for these operators; as this is the time we will know how we want the text to be interpreted.

2. Easily create a String without escaping (\n is not linefeed, but \ and n)

The ability to not interpret the backslash as escape can be useful in other scenario that creating a NSRegularExpression; like creating a Windows pathname, or creating regular expression which are then given to external tool.  So this part of the proposal should probably be generalized.


> Le 31 janv. 2016 à 12:18, Patrick Gili via swift-evolution <swift-evolution at swift.org> a écrit :
> Here is the link to the proposal on GitHub:
> https://github.com/gili-patrick-r/swift-evolution/blob/master/proposals/NNNN-regular-expression-literals.md <https://github.com/gili-patrick-r/swift-evolution/blob/master/proposals/NNNN-regular-expression-literals.md>
> Cheers,
> -Patrick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160131/b9112287/attachment.html>

More information about the swift-evolution mailing list