[erlang-questions] Backreferences in PCRE

Anders Svensson agssvensson@REDACTED
Sat Jan 22 00:30:44 CET 2011


On Fri, Jan 21, 2011 at 9:22 PM, Tristan Sloughter
<tristan.sloughter@REDACTED> wrote:
> The re modules documentation(http://www.erlang.org/doc/man/re.html)
> references backreferences like it supports them. However my attempts to use
> them failed (specifically the pattern '(.)\1\1' which works fine for me in

1> re:run("goood", "(.)\\1\\1", [{capture, all, list}]).
{match,["ooo","o"]}

/Anders




> other languages regex libraries) and I found old emails (
> http://www.trapexit.org/forum/viewtopic.php?p=45770&sid=8217e3c278c4ad9178964f5c6fb9085c)
> to this list that say they are not supported and are purposely turned off in
> PCRE. So I have a few questions:
>
> Is this the case? Is there no chance of ever adding them? What is a good way
> to implement something like /(.)\1\1/ to match 3 repeated characters if not
> with backreferences?
>
> Thanks,
> Tristan
>


More information about the erlang-questions mailing list