Bug 10796 – std.regex: ctRegex bug with '.' and $ in multi-line mode
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-11T12:48:00Z
Last change time
2013-08-11T12:49:57Z
Assigned to
nobody
Creator
dmitry.olsh
Comments
Comment #0 by dmitry.olsh — 2013-08-11T12:48:23Z
The tricky test case directly from run-time regex test suite:
import std.regex;
void main()
{
auto cr9 = ctRegex!(".*$", "gm");
auto m9 = match("First\rSecond", cr9);
assert(m9);
assert(equal(map!"a.hit"(m9), ["First", "", "Second"]));
}
Comment #1 by dmitry.olsh — 2013-08-11T12:49:57Z
(In reply to comment #0)
> The tricky test case directly from run-time regex test suite:
>
> import std.regex;
import std.algorithm;
>
> void main()
> {
> auto cr9 = ctRegex!(".*$", "gm");
> auto m9 = match("First\rSecond", cr9);
> assert(m9);
> assert(equal(map!"a.hit"(m9), ["First", "", "Second"]));
> }
Fixed:
https://github.com/D-Programming-Language/phobos/pull/1464