Bug 17520 – Different matches with ctRegex and regex on multiline inputs

Status
REOPENED
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2017-06-18T15:24:56Z
Last change time
2024-12-01T16:30:25Z
Assigned to
Dmitry Olshansky
Creator
Alexandre Bléron
Moved to GitHub: phobos#10253 →

Comments

Comment #0 by alex.bleron — 2017-06-18T15:24:56Z
ctRegex and regex give different matches in the following example: /////////////////////////////////////////// import std.regex; import std.stdio; auto directivesRegexp = regex(`(.*)`); auto ctDirectivesRegexp = ctRegex!(`(.*)`); immutable text = `line1 line2 line3 `; void main() { writeln("REGEX"); foreach (m; matchAll(text, directivesRegexp)) { writefln("match=%s", m[1]); } writeln("CTREGEX"); foreach (m; matchAll(text, ctDirectivesRegexp)) { writefln("match=%s", m[1]); } } /////////////////////////////////////////// Output: REGEX match=line1 match= match=line2 match= match= match= match=line3 match= match= CTREGEX match=line1 match=line2 match= match=line3 match= /////////////////////////////////////////// I think the behavior of ctRegex is the correct one in this case. DPaste: https://dpaste.dzfl.pl/43c4a1991357
Comment #1 by dmitry.olsh — 2017-08-25T10:10:55Z
*** This issue has been marked as a duplicate of issue 15489 ***
Comment #2 by robert.schadek — 2024-12-01T16:30:25Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10253 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB