From f25f1f7f41a03999c7abb14789424dc144ae5347 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 18 Apr 2012 18:51:03 +0300 Subject: [PATCH] std.regex: Fix math in replace example Not only was the sum of two numbers incorrect, but the replace operation seemingly added 100 to the result as well ;) --- std/regex.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/regex.d b/std/regex.d index eca449e431b..b4f0a6c8d55 100644 --- a/std/regex.d +++ b/std/regex.d @@ -6557,7 +6557,7 @@ public auto bmatch(R, RegEx)(R input, RegEx re) --- //Comify a number auto com = regex(r"(?<=\d)(?=(\d\d\d)+\b)","g"); - assert(replace("12000 + 42100 = 56000", com, ",") == "12,000 + 42,100 = 56,100"); + assert(replace("12000 + 42100 = 54100", com, ",") == "12,000 + 42,100 = 54,100"); --- The format string can reference parts of match using the following notation.