<div dir="ltr">Hello Benjamin, Ziv,<div><br></div><div>I wrote a very rough approximation to the idea that Ziv proposed, here's the code (currently, it does not do much):</div><div><br></div><div><a href="https://github.com/ashalkhakov/urweb-regex/tree/typed-regex" target="_blank">https://github.com/<wbr>ashalkhakov/urweb-regex/tree/<wbr>typed-regex</a><br></div><div><br></div><div>At first I was thinking that it would be better to introduce named groups, but now I'm wondering how to handle positional groups, instead?</div><div><br></div><div>Tangentially, I also noticed that JS does not handle capture groups mixed with repetition, e.g. </div><div><div class="gmail-m_3113799077783209894gmail-m_-5916809286904418203m_1025383886089733268gmail-m_9092465003926062511gmail-m_-1900289450241304519gmail_signature"><br></div><div class="gmail-m_3113799077783209894gmail-m_-5916809286904418203m_1025383886089733268gmail-m_9092465003926062511gmail-m_-1900289450241304519gmail_signature">'xabxabxab'.match(/(xab){3}/) // or with /(xab)*/<br></div><div class="gmail-m_3113799077783209894gmail-m_-5916809286904418203m_1025383886089733268gmail-m_9092465003926062511gmail-m_-1900289450241304519gmail_signature"><br></div><div class="gmail-m_3113799077783209894gmail-m_-5916809286904418203m_1025383886089733268gmail-m_9092465003926062511gmail-m_-1900289450241304519gmail_signature">gives: ["xabxabxab", "xab"] (would it be worth it to try to rule out cases like this statically? probably not?)</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-21 21:21 GMT+06:00 Benjamin Barenblat <span dir="ltr"><<a href="mailto:bbaren@mit.edu" target="_blank">bbaren@mit.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Feb 20, 2017 at 10:27 PM, Artyom Shalkhakov<br>
<<a href="mailto:artyom.shalkhakov@gmail.com">artyom.shalkhakov@gmail.com</a>> wrote:<br>
> Thank you for the pointer. I guess creating a new package that depends on<br>
> urweb-regex is the way to go.<br>
<br>
</span>I’m also happy to merge changes to urweb-regex. I think a richly-typed<br>
API like the one you’re looking for would be quite valuable in the<br>
regex library.<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" rel="noreferrer" target="_blank">http://www.impredicative.com/<wbr>cgi-bin/mailman/listinfo/ur</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Cheers,<br>Artyom Shalkhakov<br></div>
</div>