mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 07:51:23 +02:00
Simplify WildcardMatcher
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user