<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 23, 2017, at 9:43 AM, John Holdsworth via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hello S/E,</div><div class=""><br class=""></div><div class="">I’d like to put forward a perhaps rather banal change to the Swift lexer</div><div class="">primarily intended to make entering regular expression patterns easier.</div><div class=""><br class=""></div><div class=""><a href="https://github.com/DoubleSpeak/swift-evolution/blob/master/proposals/NNNN-raw-string-escaping.md" class="">https://github.com/DoubleSpeak/swift-evolution/blob/master/proposals/NNNN-raw-string-escaping.md</a></div></div></div></blockquote><div><br class=""></div><div>Hi John,</div><div><br class=""></div><div>A lot of people (myself included) are interested in getting regex’s into Swift. &nbsp;I don’t think there is consensus on how to do this, but I’m personally a fan of adding first class support with the classical /a[b*]c/ syntax. &nbsp;Until we figure out that path forward for regex’s, I think they aren’t the right motivation for this proposal.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div class="">With a raw literal a string prefixed by “r” the \ character would have no</div><div class="">special role at all and be processed like any other character i.e.</div><div class=""><br class=""></div></div><div class=""><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="" class="">&nbsp; &nbsp;&nbsp;r</span>"\n\(var)\n"<span style="" class=""> </span><span style="text-decoration: underline;" class="">=</span><span style="" class="">= </span>"\\n\\(var)\\n"</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="" class="">&nbsp; &nbsp; r</span>"\?\y\="<span style="" class=""> </span><span style="text-decoration: underline;" class="">=</span><span style="" class="">= </span>"\\?\\y\\="</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="" class="">&nbsp; &nbsp; r</span>"c:\windows\system32"<span style="" class=""> </span><span style="text-decoration: underline;" class="">=</span><span style="" class="">= </span>"c:\\windows\\system32"</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">&nbsp; &nbsp; r<span style="color: #d12f1b" class="">"""</span></div><div style="margin: 0px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; Line One\</div><div style="margin: 0px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; Line Two\</div><div style="margin: 0px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; """<span style="" class=""> </span><span style="text-decoration: underline;" class="">=</span><span style="" class="">= </span>"Line One\\\nLineTwo\\"</div><div class=""><br class=""></div><div class=""><div style="font-family: Helvetica; font-size: 12px;" class="">I had considered another version of the proposal where known escapes</div><div style="font-family: Helvetica; font-size: 12px;" class="">were still processed but it proved too difficult to reason exactly what was</div><div style="font-family: Helvetica; font-size: 12px;" class="">contained in the string.</div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">There is a example toolchain available for testing:</div></div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div></div></div></div></div></div><div class=""><a href="http://johnholdsworth.com/swift-LOCAL-2017-11-23-a-osx.tar.gz" class="">http://johnholdsworth.com/swift-LOCAL-2017-11-23-a-osx.tar.gz</a></div><div class=""><br class=""></div><div class="">Can we shepard this minor additive change into Swift 4.1?</div><div class=""><br class=""></div><div class="">John</div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>