Bug 16251 – regex - `(..).*\1` doesn't match "axxxx"

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-07-08T02:12:36Z
Last change time
2017-08-25T10:13:16Z
Assigned to
Dmitry Olshansky
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2016-07-08T02:12:36Z
////////////////// test.d ///////////////// import std.regex; void main() { assert("axxxx".matchFirst(`(..).*\1`)); } ///////////////////////////////////////////
Comment #1 by tjfryan — 2016-07-12T06:56:16Z
The \1 token isn't context free. The regex module doesn't appear to currently support any context sensitive tokens.
Comment #2 by dlang-bugzilla — 2016-07-13T03:34:21Z
(In reply to TJ Ryan from comment #1) > The regex module doesn't appear to > currently support any context sensitive tokens. What makes you say that?
Comment #3 by greeenify — 2016-12-27T13:38:24Z
> What makes you say that? That it's not part of the documentation? https://dlang.org/phobos/std_regex.html
Comment #4 by dlang-bugzilla — 2016-12-27T15:48:26Z
Strange. Well, it works for simpler cases, so it's either an unfinished feature, or an undocumented and buggy one.
Comment #5 by dlang-bugzilla — 2016-12-27T15:54:57Z
Comment #6 by dmitry.olsh — 2017-08-24T11:31:02Z
(In reply to Vladimir Panteleev from comment #5) > There are some backreference tests here: > > https://github.com/dlang/phobos/blob/master/std/regex/internal/tests.d#L310- > L315 Backreference should be fully supported. However instead it supported a subset of all possible backreferences, until now I postponed the issue as not blocking most practical uses of backreferences.
Comment #7 by dmitry.olsh — 2017-08-25T10:13:16Z
*** This issue has been marked as a duplicate of issue 15489 ***