[erlang-bugs] Bug with named subpatterns in re module

Sergei Golovan <>
Thu Mar 28 17:52:56 CET 2013


On Thu, Mar 28, 2013 at 8:13 PM, Patrik Nyblom <> wrote:
> Well, removing dupnames might be the easiest, but as there are perl
> semantics we can imitate, I think we should give it a try!

I should say that PCRE manual describes named subpatterns using the
following regexp:


(search 'NAMED SUBPATTERNS' in http://www.pcre.org/pcre.txt). And currently

1> re:run("Monday",
[dupnames, {capture, ['DN'], list}]).

doesn't work. If I leave only one branch it works fine:
2> re:run("Monday", "(?<DN>Mon|Fri|Sun)(?:day)?", [dupnames, {capture,
['DN'], list}]).

Sergei Golovan

More information about the erlang-bugs mailing list