Bug 2487 – regexp .* fails to capture space in a greedy way

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2008-12-02T13:05:00Z
Last change time
2014-03-01T00:36:51Z
Assigned to
nobody
Creator
swadenator

Comments

Comment #0 by swadenator — 2008-12-02T13:05:18Z
The following regexp: con = new RegExp(r"^(.*) .*$"); When used to find "y vn z w" returns "y" for the expression con.match(1). It should match "y vn z". Sample Code: import std.stdio; import std.regexp; int main() { RegExp con = new RegExp(r"^(.*) .*$"); char[] line = "y vn z w"; int ret = con.find(line); fwritef(stderr, "return value = %d, match(1) == %s\n", ret, con.match(1)); return 0; }
Comment #1 by dsimcha — 2009-10-18T07:44:51Z
*** This issue has been marked as a duplicate of issue 2108 ***