diff --git a/Core/ByteSizeFormatter.cs b/Core/ByteSizeFormatter.cs index 7eade816..2a179d5c 100644 --- a/Core/ByteSizeFormatter.cs +++ b/Core/ByteSizeFormatter.cs @@ -26,7 +26,7 @@ namespace Vanara try { bytes = Convert.ToInt64(arg); } catch { return HandleOtherFormats(format, arg); } if (bytes == 0) return "0" + suffixes[0]; - var m = System.Text.RegularExpressions.Regex.Match(format, "^[B|b](?\\d+)$"); + var m = System.Text.RegularExpressions.Regex.Match(format, @"^[B|b](?\d+)?$"); if (!m.Success) return HandleOtherFormats(format, arg); var prec = m.Groups["prec"].Success ? byte.Parse(m.Groups["prec"].Value) : 0; var place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));