[swift-evolution] Empower String type with regular expression
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>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution