[Issue 7260] "g" on default in std.regex

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 17 05:33:52 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=7260



--- Comment #10 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-08-17 05:33:49 PDT ---
The problem now should is addressed by this pull
https://github.com/D-Programming-Language/phobos/pull/1470

There is matchAll/matchFirst calls now that are the prefered way to go about
matching. Currently they simply override global flag if present.
Returning to the original example:

foreach (c; text.matchAll("1|2|3|4")) //this spins over captures of each match
        write(c, " ");
writeln();

foreach (c; text.matchFirst("1|2|3|4")) //this spins submatches of 1st match
        write(c, " ");
writeln();

To me there is little else to do aside from slooowly deprecating old flag-based
match/replace interface.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list