fix issue 10913 @safety of std.regex replace API
Merge pull request #1532 from blackwhale/fix-replace-check

Fix issue 10913 std.regex API regression