Simplify WildcardMatcher

This commit is contained in:
Stef Heyenrath
2017-02-04 15:55:11 +01:00
parent 841da80291
commit 9b99a7f26b
2 changed files with 14 additions and 98 deletions

View File

@@ -18,12 +18,18 @@ namespace WireMock.Matchers
/// Initializes a new instance of the <see cref="RegexMatcher"/> class.
/// </summary>
/// <param name="pattern">The pattern.</param>
public RegexMatcher([NotNull, RegexPattern] string pattern)
/// <param name="ignoreCase">IgnoreCase</param>
public RegexMatcher([NotNull, RegexPattern] string pattern, bool ignoreCase = false)
{
Check.NotNull(pattern, nameof(pattern));
_pattern = pattern;
_expression = new Regex(_pattern, RegexOptions.Compiled);
RegexOptions options = RegexOptions.Compiled;
if (ignoreCase)
options |= RegexOptions.IgnoreCase;
_expression = new Regex(_pattern, options);
}
/// <summary>