diff --git a/src/Humanizer/RomanNumeralExtensions.cs b/src/Humanizer/RomanNumeralExtensions.cs index 4df0c038e..2d9d22504 100644 --- a/src/Humanizer/RomanNumeralExtensions.cs +++ b/src/Humanizer/RomanNumeralExtensions.cs @@ -11,28 +11,23 @@ public static class RomanNumeralExtensions private static readonly Dictionary romanNumerals = new Dictionary(NumberOfRomanNumeralMaps) { - { "M", 1000 }, - { "CM", 900 }, - { "D", 500 }, - { "CD", 400 }, - { "C", 100 }, - { "XC", 90 }, - { "L", 50 }, - { "XL", 40 }, - { "X", 10 }, - { "IX", 9 }, - { "V", 5 }, - { "IV", 4 }, + { "M", 1000 }, + { "CM", 900 }, + { "D", 500 }, + { "CD", 400 }, + { "C", 100 }, + { "XC", 90 }, + { "L", 50 }, + { "XL", 40 }, + { "X", 10 }, + { "IX", 9 }, + { "V", 5 }, + { "IV", 4 }, { "I", 1 } }; private static readonly Regex validRomanNumeral = new Regex("^(?i:(?=[MDCLXVI])((M{0,3})((C[DM])|(D?C{0,3}))" + "?((X[LC])|(L?XX{0,2})|L)?((I[VX])|(V?(II{0,2}))|V)?))$", RegexOptions.None); - private static bool IsInvalidRomanNumeral(string value) - { - return !validRomanNumeral.IsMatch(value); - } - /// /// Converts Roman numbers into integer /// @@ -100,5 +95,10 @@ public static string ToRoman(this int value) return sb.ToString(); } + + private static bool IsInvalidRomanNumeral(string value) + { + return !validRomanNumeral.IsMatch(value); + } } } \ No newline at end of file