diff --git a/src/WireMock.Net/Matchers/RegexMatcher.cs b/src/WireMock.Net/Matchers/RegexMatcher.cs
index 54ae243a..73b03b6e 100644
--- a/src/WireMock.Net/Matchers/RegexMatcher.cs
+++ b/src/WireMock.Net/Matchers/RegexMatcher.cs
@@ -56,7 +56,7 @@ namespace WireMock.Matchers
/// Gets the pattern.
///
/// Pattern
- public string GetPattern()
+ public virtual string GetPattern()
{
return _pattern;
}
diff --git a/src/WireMock.Net/Matchers/WildcardMatcher.cs b/src/WireMock.Net/Matchers/WildcardMatcher.cs
index cb350f25..74690685 100644
--- a/src/WireMock.Net/Matchers/WildcardMatcher.cs
+++ b/src/WireMock.Net/Matchers/WildcardMatcher.cs
@@ -9,6 +9,8 @@ namespace WireMock.Matchers
///
public class WildcardMatcher : RegexMatcher
{
+ private readonly string _pattern;
+
///
/// Initializes a new instance of the class.
///
@@ -16,6 +18,16 @@ namespace WireMock.Matchers
/// IgnoreCase
public WildcardMatcher([NotNull] string pattern, bool ignoreCase = false) : base("^" + Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", ".") + "$", ignoreCase)
{
+ _pattern = pattern;
+ }
+
+ ///
+ /// Gets the pattern.
+ ///
+ /// Pattern
+ public override string GetPattern()
+ {
+ return _pattern;
}
///
@@ -24,7 +36,7 @@ namespace WireMock.Matchers
///
/// Name
///
- public new string GetName()
+ public override string GetName()
{
return "WildcardMatcher";
}