internal static RegexOptions ConvertToRegexOptions(StringComparison comparisonType) { RegexOptions result = RegexOptions.None; if (comparisonType.HasFlag(StringComparison.InvariantCulture)) { result |= RegexOptions.CultureInvariant; } if (comparisonType.HasFlag(StringComparison.CurrentCultureIgnoreCase) || comparisonType.HasFlag(StringComparison.InvariantCultureIgnoreCase) || comparisonType.HasFlag(StringComparison.OrdinalIgnoreCase)) { result |= RegexOptions.IgnoreCase; } return(result); }
public static bool IsIgnoreCase(this StringComparison stringComparison) { return(ignoreCases.HasFlag(stringComparison)); }