<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=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m beginning to wish I hadn’t tied this proposal so strongly to regular expressions!<div class="">It is indeed the wrong motivation. Even as a ten year veteran of Perl development</div><div class="">I’m not sure we want to bake it into the language quite so tightly (isn’t a part of</div><div class="">Foundation?) What would /regex/ represent - an instance of NSRegularExpression?</div><div class="">Would the flags be pattern options or matching options? This is a whole other debate.<div class=""><br class=""></div><div class="">For me the focus of raw strings was a sort of super-literal literal which has many</div><div class="">applications. The r”literal” syntax has a precedent in Python and there seemed</div><div class="">to be a syntactic gap that could be occupied but perhaps there are other alternatives </div><div class="">we could discuss. It would be a shame to see ‘quoted strings’ be used for this however.</div><div class="">I still live in hope one day it will be used for single character UNICODE values.</div><div class=""><br class=""></div><div class="">John<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 23 Nov 2017, at 19:10, Brent Royal-Gordon <<a href="mailto:brent@architechies.com" class="">brent@architechies.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">On Nov 23, 2017, at 11:15 AM, Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></span></font></div><blockquote type="cite" class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Until we figure out that path forward for regex’s, I think they aren’t the right motivation for this proposal.</span></font></blockquote><div class=""><br class=""></div><div class="">1. Even in our shining pattern matching future—a future which I, for one, am eager to hasten—we will still need to interoperate with NSRegularExpression and other Perl 5-compatible regex engines.</div><div class=""><br class=""></div><div class="">2. Code generation.</div><div class=""><br class=""></div><div class="">3. Windows-style paths. </div><div class=""><br class=""></div><div class="">4. Doesn’t LaTeX use backslashes?</div><div class=""><br class=""></div><div class="">5. Etc. </div><div class=""><br class=""></div><div class="">I think the Motivation section undersells this proposal. Regexes are a strong short-run use case, but in the long run, we’ll need this for other things. In both cases, though, raw literals will be a useful addition to the language, improving the clarity of Swift code much like multiline literals already have. </div><br class=""><div class=""><div class="">-- </div><div class="">Brent Royal-Gordon</div>Sent from my iPhone</div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></div></body></html>