diff --git a/src/Humanizer/Inflections/Vocabulary.cs b/src/Humanizer/Inflections/Vocabulary.cs index 745742d10..d80d7e6de 100644 --- a/src/Humanizer/Inflections/Vocabulary.cs +++ b/src/Humanizer/Inflections/Vocabulary.cs @@ -187,7 +187,7 @@ string LetterS(string word) class Rule(string pattern, string replacement) { - readonly Regex regex = new(pattern, RegexOptions.IgnoreCase | RegexOptionsUtil.Compiled); + readonly Regex regex = new(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); public string Apply(string word) { diff --git a/src/Humanizer/RegexOptionsUtil.cs b/src/Humanizer/RegexOptionsUtil.cs deleted file mode 100644 index ee2f22dec..000000000 --- a/src/Humanizer/RegexOptionsUtil.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Humanizer -{ - static class RegexOptionsUtil - { - static RegexOptionsUtil() => - Compiled = Enum.TryParse("Compiled", out RegexOptions compiled) ? compiled : RegexOptions.None; - - public static RegexOptions Compiled { get; } - } -} diff --git a/src/Humanizer/RomanNumeralExtensions.cs b/src/Humanizer/RomanNumeralExtensions.cs index 6c5d3c94d..306af6bc0 100644 --- a/src/Humanizer/RomanNumeralExtensions.cs +++ b/src/Humanizer/RomanNumeralExtensions.cs @@ -30,7 +30,7 @@ public static class RomanNumeralExtensions static readonly Regex ValidRomanNumeral = new( "^(?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)?))$", - RegexOptionsUtil.Compiled); + RegexOptions.Compiled); /// /// Converts Roman numbers into integer diff --git a/src/Humanizer/StringHumanizeExtensions.cs b/src/Humanizer/StringHumanizeExtensions.cs index dfdaea676..4e09bb33e 100644 --- a/src/Humanizer/StringHumanizeExtensions.cs +++ b/src/Humanizer/StringHumanizeExtensions.cs @@ -18,8 +18,8 @@ static StringHumanizeExtensions() { PascalCaseWordPartsRegex = new( $"({OptionallyCapitalizedWord}|{IntegerAndOptionalLowercaseLetters}|{Acronym}|{SequenceOfOtherLetters}){MidSentencePunctuation}", - RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptionsUtil.Compiled); - FreestandingSpacingCharRegex = new(@"\s[-_]|[-_]\s", RegexOptionsUtil.Compiled); + RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled); + FreestandingSpacingCharRegex = new(@"\s[-_]|[-_]\s", RegexOptions.Compiled); } static string FromUnderscoreDashSeparatedWords(string input) =>