std.regex.replace does not compile with wstring: auto x = std.regex.regex ("abc"w); wchar[] buffer = "abc"w.dup; std.regex.replace (buffer, x, "def"w);