Use std.regex.replaceAll instead of replace().

replace() is now deprecated and required the regex to be compiled with
specific flags; the new API uses replaceAll().

Fixes issue 10896.