Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant RegexOptionsUtil #1399

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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