RegexExtended in settings (#700)

* Add extra unittest for RegexExtended

* settings
This commit is contained in:
Stef Heyenrath
2021-12-12 15:40:38 +01:00
committed by GitHub
parent 4a434b5dba
commit 6943b90da6
8 changed files with 71 additions and 24 deletions

View File

@@ -41,6 +41,7 @@ namespace WireMock.Serialization
var matchBehaviour = matcher.RejectOnMatch == true ? MatchBehaviour.RejectOnMatch : MatchBehaviour.AcceptOnMatch;
bool ignoreCase = matcher.IgnoreCase == true;
bool throwExceptionWhenMatcherFails = _settings.ThrowExceptionWhenMatcherFails == true;
bool useRegexExtended = _settings.UseRegexExtended == true;
switch (matcherName)
{
@@ -65,7 +66,7 @@ namespace WireMock.Serialization
return CreateExactObjectMatcher(matchBehaviour, stringPatterns[0], throwExceptionWhenMatcherFails);
case nameof(RegexMatcher):
return new RegexMatcher(matchBehaviour, stringPatterns, ignoreCase, throwExceptionWhenMatcherFails);
return new RegexMatcher(matchBehaviour, stringPatterns, ignoreCase, throwExceptionWhenMatcherFails, useRegexExtended);
case nameof(JsonMatcher):
object valueForJsonMatcher = matcher.Pattern ?? matcher.Patterns;