[Issue 14159] New: Bug in ctRegex - "Error: found 'else' instead of statement"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Feb 9 12:34:39 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14159

          Issue ID: 14159
           Summary: Bug in ctRegex - "Error: found 'else' instead of
                    statement"
           Product: D
           Version: D2
          Hardware: Other
                OS: Other
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: Dbugs at m3.sent.com

The following regular expression string (valid as it works in non-compile time
regex) causes the "Error: found 'else' instead of statement" compile time
message:

"/usr/include/dmd/phobos/std/regex.d-mixin-5885(5943): Error: found 'else'
instead of statement"

---
import std.regex;

auto commentRx = ctRegex!(`.*?(//.*[\r\n]|/\*(?:.|[\r\n])*?\*/)`, "gm");

void main() {}
---

This is as observed on hackerrank.com which used D Version 2.066.

See https://www.hackerrank.com/environment

--


More information about the Digitalmars-d-bugs mailing list