Test code: string s1 = "abc bcf"; string s2 = s1.replaceFirst("bc", "ee"); writefln("%s\n%s", s1, s2); The s2 should be "aee bcf", however the result of replaceFirst is "aee".
I have a patch: --- array.d Sun Jul 10 13:19:30 2011 +++ array-new.d Tue Aug 02 21:58:12 2011 @@ -1522,7 +1522,7 @@ auto app = appender!R1(); app.put(subject[0 .. subject.length - balance.length]); app.put(to.save); - subject = balance[from.length .. $]; + app.put(balance[from.length .. $]); return app.data; }
https://github.com/D-Programming-Language/phobos/pull/168