digitalmars.D.bugs - [Issue 2487] New: regexp .* fails to capture space in a greedy way
- d-bugmail puremagic.com (28/28) Dec 02 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2487
- d-bugmail puremagic.com (12/12) Oct 18 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2487
http://d.puremagic.com/issues/show_bug.cgi?id=2487 Summary: regexp .* fails to capture space in a greedy way Product: D Version: 1.037 Platform: Macintosh OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: bugzilla digitalmars.com ReportedBy: swadenator gmail.com 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; } --
Dec 02 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2487 David Simcha <dsimcha yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |dsimcha yahoo.com Resolution| |DUPLICATE *** This issue has been marked as a duplicate of issue 2108 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 18 2009