Bug 2107 – Regexp multiline attribute is broken

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-05-14T22:06:00Z
Last change time
2015-06-09T01:14:36Z
Assigned to
andrei
Creator
nyphbl8d

Comments

Comment #0 by nyphbl8d — 2008-05-14T22:06:22Z
When matching on text that includes newlines, multiline matching (splitting the string on newlines first and then matching on individual lines) seems to be the default and makes the "m" attribute useless. It also requires the removal of all newlines if they need to be matched over. The following code snippet should show the issue: if (auto m = std.regexp.search("foo\nbar","f.*r")) { writefln("match found: %s",m.match(0)); } else { writefln("no match!"); }
Comment #1 by andrei — 2010-09-25T22:21:18Z
The "m" flag refers to the behavior of ^ and $, not that of the dot.