<div dir="ltr">On Sat, Jan 28, 2012 at 15:26, Ilya Portnov <span dir="ltr">&lt;<a href="mailto:portnov@iportnov.ru">portnov@iportnov.ru</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a way to get named captures from regex using regex-pcre (or maybe other PCRE-package)? For example, I want to write something like<br></blockquote><div><br></div><div>regex-pcre is constrained by the common Haskell regex API (used by all the regex-* packages), which doesn&#39;t support named captures.  Unfortunately, it doesn&#39;t look like pcre-light will return the kind of capture alist you want either; it uses the basic pcre_exec() function and doesn&#39;t appear to provide an API for pcre_get_named_substring() etc.</div>
<div><br></div><div>dons doesn&#39;t seem to be very active any more (sandbagged by job?), so pcre-light (which looks to be the obvious place for it given that Text.Regex.PCRE.Base already provides a partial raw API) is likely open to adoption; you could add the named capture API to T.R.P.Base and possibly develop a more Haskell-like API later.</div>
<div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>