
28 Jan
2012
28 Jan
'12
8:26 p.m.
Hi haskell-cafe. 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 let result = "ab 12 cd" =~ "ab (?P<number>\d+) cd" :: SomeCrypticType and then have namedCaptures result == [("number", "12")]. I do not see somewhat similar in regex-pcre documentation. It parses such regexs fine, and captures work, but i do not see way to get _named_ captures. WBR, Ilya Portnov.