<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On 01 Feb 2016, at 04:39, Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="">I am +1 on the concept of adding regex literals to Swift, but -1 on this proposal.</div><div class=""><br class=""></div><div class="">Specifically, instead of introducing regex literals, I’d suggest that you investigate introducing regex’s to the pattern grammar, which is what Swift uses for matching already. Regex’s should be usable in the cases of a switch, for example. Similarly, they should be able to bind variables directly to sub patterns.</div></div></div></blockquote><div><br class=""></div><div>These two things seem somewhat orthogonal to me, but I am also much more excited about what you propose; many languages have regex literals, and that’s great, but allowing them in pattern matching with variable binding and efficient parallel execution is much rarer.</div><div><br class=""></div><div>Standard regex literals isn’t too important for Swift, IMO. Writing /…../ or Regex(‘…..’) isn’t that different, really. Regex could be initialised from strings as well, making the difference even smaller.</div><div><br class=""></div><div>-Sune</div><div><br class=""></div></div></body></html>