Fix std.regex.replace signature and constraints

* Remove code bloat by instantiating once per *character* type.

* Allow any qualifiers by taking const.

* The function essentially builds its input internally and thus produces mutable result.

I'm not sure if that last bit could cause any trouble for any existing code.