Bug 10802 – std.regex: ctRegex fails to compile with backreference

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-11T14:04:00Z
Last change time
2013-08-11T14:06:06Z
Assigned to
nobody
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2013-08-11T14:04:41Z
Test-case: import std.algorithm, std.regex; void main() { auto cr = ctRegex!`(a)b\1`; auto m = match("abaab", cr); assert(m); assert(m.hit == "aba"); } Produces: std\regex.d(6447): Error: found '..' when expecting ';' following statement std\regex.d(6447): Error: found ']' when expecting ';' following statement std\regex.d(6447): Error: dotvar has no effect in expression ((*__withSym).matches[cast(uint)1].begin) std\regex.d(6447): Error: dotvar has no effect in expression ((*__withSym).matches[cast(uint)1].end) std\regex.d(6448): Error: undefined identifier referenced std\regex.d(6448): Error: undefined identifier referenced std\regex.d(6451): Error: undefined identifier referenced std\regex.d(6453): Error: undefined identifier referenced Failed: "dmd" "-v" "-o-" "test_reg.d" "-I."
Comment #1 by dmitry.olsh — 2013-08-11T14:06:06Z