Skip to content

Commit

Permalink
remove redundant RegexOptionsUtil (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 17, 2024
1 parent 1246853 commit a3af303
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Humanizer/Inflections/Vocabulary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
10 changes: 0 additions & 10 deletions src/Humanizer/RegexOptionsUtil.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Humanizer/RomanNumeralExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/// <summary>
/// Converts Roman numbers into integer
Expand Down
4 changes: 2 additions & 2 deletions src/Humanizer/StringHumanizeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down

0 comments on commit a3af303

Please sign in to comment.