Summary: std.regex (...){n,m} is bogus when (...) contains
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Phobos

--- Comment #0 from Dmitry Olshansky <> 2011-04-18 
13:42:29 PDT ---
Uncovered while fixing greediness issues in current implementation.

For instance:

import std.regex;
void main(){
    auto c = match("axxxzayyyyyzd",regex("(a.*z){2}d")).captures;
    assert(c[0] == "axxxzayyyyyzd"); //asserts, there is no match ?!
    assert(c[1] == "ayyyyyz");

While it's certainly matches, try
(both PHP preg & JavaScript one).
The reason is that .* on the first iteration jumps out of ...{2} "scope",
skipping next  iteration of '(a.*z)' before trying 'd'.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to