<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="">Thank you for the reply. The part I didn’t understand is if if giving names to the captured groups would be mandatory. Hopefully not.<div class=""><br class=""></div><div class="">Assuming we the user does not need names, the groups could be captures on an unlabeled tuple.</div><div class=""><br class=""></div><div class="">Digits could always be inferred to be numeric (Int) and they should always be “exact” (to match "\d"):</div><div class=""><br class=""></div><div class=""><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">let usPhoneNumber: Regex = (</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">.digits(3) + "-“).oneOrZero + .</span><font color="#4f8187" face="Menlo" style="background-color: rgb(255, 255, 255);" class=""><span style="font-size: 11px;" class="">digits(3) +&nbsp;“-“ +&nbsp;</span></font><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">.digits(4)</span></div><div class=""><br class=""></div><div class="">Personally, I like the `.optional` better than `.oneOrZero`:</div><div class=""><br class=""></div><div class=""><div class=""><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">let usPhoneNumber = Regex.optional(</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">.digits(3) + "-“) + .</span><font color="#4f8187" face="Menlo" style="background-color: rgb(255, 255, 255);" class=""><span style="font-size: 11px;" class="">digits(3) +&nbsp;“-“ +&nbsp;</span></font><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">.digits(4)</span></div></div><div class=""><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class="">Would it be possible to support both condensed and extended syntax?&nbsp;</div><div class=""><br class=""></div><div class=""><div class=""><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">let usPhoneNumber = / (\d{</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">3} + "-“)? + (\d{</span><font color="#4f8187" face="Menlo" style="background-color: rgb(255, 255, 255);" class=""><span style="font-size: 11px;" class="">3}) +&nbsp;“-“ + (\</span></font><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">d{4}) /</span></div><div class=""><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class="">Maybe only extended (verbose) syntax would support named groups?</div><div class=""><br class=""></div><div class=""><div class="">Eneko</div></div><div class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 16, 2018, at 10:01 AM, George Leontiev &lt;<a href="mailto:georgeleontiev@gmail.com" class="">georgeleontiev@gmail.com</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; line-break: after-white-space;" class="">@Eneko While it sure seems possible to specify the type, I think this would go against the salient point "If something’s worth capturing, it’s worth giving it a name.” Putting the name further away seems like a step backward.<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(40, 43, 53); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: &quot;Helvetica Neue&quot;; color: rgb(255, 255, 255); background-color: rgb(40, 43, 53);" class="">I could imagine a slightly more succinct syntax where things like .numberFromDigits are replaced by protocol conformance of the bound type:</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: &quot;Helvetica Neue&quot;; color: rgb(255, 255, 255); background-color: rgb(40, 43, 53);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106); background-color: rgb(40, 43, 53);" class="">extension Int: Regexable {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106); background-color: rgb(40, 43, 53);" class="">&nbsp; &nbsp; func baseRegex&lt;T&gt;() -&gt; Regex&lt;T, Int&gt;</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106); background-color: rgb(40, 43, 53);" class="">}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106); background-color: rgb(40, 43, 53);" class="">let usPhoneNumber = (/let area: Int/.exactDigits(3) + "-").oneOrZero +</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106); background-color: rgb(40, 43, 53);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let routing: Int/.exactDigits(3) + "-" +</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106); background-color: rgb(40, 43, 53);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let local: Int/.exactDigits(4)</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: &quot;Helvetica Neue&quot;; color: rgb(255, 255, 255); background-color: rgb(40, 43, 53);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(40, 43, 53); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: &quot;Helvetica Neue&quot;; color: rgb(255, 255, 255); background-color: rgb(40, 43, 53);" class="">In this model, the <span style="color: #68878f" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(147, 201, 106);" class="">//</span><span style="color: #68878f" class="">`</span> syntax will only be used for initial binding and swifty transformations will build the final regex.</div><div class=""><br class=""></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 16, 2018, at 9:20 AM, Eneko Alonso 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; line-break: after-white-space;" class="">Could it be possible to specify the regex type ahead avoiding having to specify the type of each captured group?<div class=""><br class=""></div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);"><font color="#4f8187" face="Menlo" class=""><span style="font-size: 11px;" class="">let usPhoneNumber</span></font><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">:&nbsp;</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">Regex&lt;UnicodeScalar,</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">(area: Int?, routing: Int, local: Int)&gt;</span><span style="font-size: 11px; color: rgb(79, 129, 135); font-family: Menlo;" class="">&nbsp;= /</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);"><font color="#4f8187" face="Menlo" class=""><span style="font-size: 11px;" class="">&nbsp; (\d{3}?) -<br class="">&nbsp; (\d{3}) -<br class="">&nbsp; (\d{4}) /<br class=""></span></font><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">“Verbose” alternative:</div></div></div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);">let usPhoneNumber:&nbsp;Regex&lt;UnicodeScalar,&nbsp;(area: Int?, routing: Int, local: Int)&gt;&nbsp;= /&nbsp;</div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);">&nbsp; .optional(.numberFromDigits(.exactly(3)) + "-“) +</div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);">&nbsp; .numberFromDigits(.exactly(3)) + "-"</div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);">&nbsp; .numberFromDigits(.exactly(4)) /</div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);">print(type(of: usPhoneNumber)) // =&gt; Regex&lt;UnicodeScalar, (area: Int?, routing: Int, local: Int)&gt;</div></div><div class=""><br class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Eneko</div><div class=""><br class=""></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 16, 2018, at 8:52 AM, George Leontiev 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; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">Thanks, Michael. This is very interesting!</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">I wonder if it is worth considering (for lack of a better word) <span style="color: #957e35" class="">*</span><i class="">verbose</i><span style="color: #957e35" class="">*</span> regular expression for Swift.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">For instance, your example:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">let usPhoneNumber = /</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; (let area: Int? &lt;- \d{3}?) -</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; (let routing: Int &lt;- \d{3}) -</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; (let local: Int &lt;- \d{4}) /</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">would become something like (strawman syntax):</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">let usPhoneNumber = /let area: Int? &lt;- .numberFromDigits(.exactly(3))/ + "-" +</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let routing: Int &lt;- .numberFromDigits(.exactly(3))/ + "-"</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let local: Int &lt;- .numberFromDigits(.exactly(4))/</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">With this format, I also noticed that your code wouldn't match "555-5555", only "-555-5555", so maybe it would end up being something like:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">let usPhoneNumber = .optional(/let area: Int &lt;- .numberFromDigits(.exactly(3))/ + "-") +</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let routing: Int &lt;- .numberFromDigits(.exactly(3))/ + "-"</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let local: Int &lt;- .numberFromDigits(.exactly(4))/</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">Notice that <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">area</span><span style="color: #957e35" class="">`</span> is initially a non-optional <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Int</span><span style="color: #957e35" class="">`</span>, but becomes optional when transformed by the <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">optional</span><span style="color: #957e35" class="">`</span> directive.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">Other directives may be:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">let decimal = /let beforeDecimalPoint: Int &lt;-- .numberFromDigits(.oneOrMore)/ +</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .optional("." + /let afterDecimalPoint: Int &lt;-- .numberFromDigits(.oneOrMore)/</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">In this world, the <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">/&lt;--/</span><span style="color: #957e35" class="">`</span> format will only be used for explicit binding, and the rest will be inferred from generic <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">+</span><span style="color: #957e35" class="">`</span> operators.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">I also think it would be helpful if <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Regex</span><span style="color: #957e35" class="">`</span> was generic over all sequence types.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">Going back to the phone example, this would looks something like:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">let usPhoneNumber = .optional(/let area: Int &lt;- .numberFromDigits(.exactly(3))/ + "-") +</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let routing: Int &lt;- .numberFromDigits(.exactly(3))/ + "-"</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /let local: Int &lt;- .numberFromDigits(.exactly(4))/</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">print(type(of: usPhoneNumber)) // =&gt; Regex&lt;UnicodeScalar, (area: Int?, routing: Int, local: Int)&gt;</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: &quot;Helvetica Neue&quot;; background-color: rgb(255, 255, 255);" class="">Note the addition of <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">UnicodeScalar</span><span style="color: #957e35" class="">`</span> to the signature of <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Regex</span><span style="color: #957e35" class="">`</span>. Other interesting signatures are <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Regex&lt;JSONToken, JSONEnumeration&gt;</span><span style="color: #957e35" class="">`</span> or <span style="color: #957e35" class="">`</span><span style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Regex&lt;HTTPRequestHeaderToken, HTTPRequestHeader&gt;</span><span style="color: #957e35" class="">`</span>. Building parsers becomes fun!</div><div class=""><br class=""></div><div class="">- George</div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 10, 2018, at 11:58 AM, Michael Ilseman 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=""><div class="">Hello, I just sent an email to swift-dev titled "State of String: ABI, Performance, Ergonomics, and You!” at <a href="https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20180108/006407.html" class="">https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20180108/006407.html</a>, whose gist can be found at <a href="https://gist.github.com/milseman/bb39ef7f170641ae52c13600a512782f" class="">https://gist.github.com/milseman/bb39ef7f170641ae52c13600a512782f</a>. I posted to swift-dev as much of the content is from an implementation perspective, but it also addresses many areas of potential evolution. Please refer to that email for details; here’s the recap from it:<br class=""><br class="">### Recap: Potential Additions for Swift 5<br class=""><br class="">* Some form of unmanaged or unsafe Strings, and corresponding APIs<br class="">* Exposing performance flags, and some way to request a scan to populate them<br class="">* API gaps<br class="">* Character and UnicodeScalar properties, such as isNewline<br class="">* Generalizing, and optimizing, String interpolation<br class="">* Regex literals, Regex type, and generalized pattern match destructuring<br class="">* Substitution APIs, in conjunction with Regexes.<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>