@@ -43,13 +43,8 @@ public Response<List<PlaceholderNameAndValue>> Find(string path, string query, s
43
43
}
44
44
45
45
private const int PlaceholdersMilliseconds = 1000 ;
46
- #if NET7_0_OR_GREATER
47
46
[ GeneratedRegex ( @"\{(.*?)\}" , RegexOptions . None , PlaceholdersMilliseconds ) ]
48
47
private static partial Regex RegexPlaceholders ( ) ;
49
- #else
50
- private static readonly Regex _regexPlaceholders = RegexGlobal . New ( @"\{(.*?)\}" , RegexOptions . None , TimeSpan . FromMilliseconds ( PlaceholdersMilliseconds ) ) ;
51
- private static Regex RegexPlaceholders ( ) => _regexPlaceholders ;
52
- #endif
53
48
54
49
/// <summary>Finds the placeholders in the request path and query.
55
50
/// We use a <see cref="Regex"/> pattern to match the placeholders in the path template.
@@ -107,13 +102,8 @@ string MatchEvaluator(Match match)
107
102
}
108
103
109
104
private const int CatchAllQueryMilliseconds = 300 ;
110
- #if NET7_0_OR_GREATER
111
105
[ GeneratedRegex ( @"^[^{{}}]*\?\{(.*?)\}$" , RegexOptions . None , CatchAllQueryMilliseconds ) ]
112
106
private static partial Regex RegexCatchAllQuery ( ) ;
113
- #else
114
- private static readonly Regex _regexCatchAllQuery = RegexGlobal . New ( @"^[^{{}}]*\?\{(.*?)\}$" , RegexOptions . None , TimeSpan . FromMilliseconds ( CatchAllQueryMilliseconds ) ) ;
115
- private static Regex RegexCatchAllQuery ( ) => _regexCatchAllQuery ;
116
- #endif
117
107
118
108
/// <summary>Checks if the path template contains a Catch-All query parameter.
119
109
/// <para>It means that the path template ends with a question mark and a placeholder.
@@ -129,13 +119,8 @@ private static (bool IsMatch, string Placeholder) IsCatchAllQuery(string templat
129
119
}
130
120
131
121
private const int CatchAllPathMilliseconds = 300 ;
132
- #if NET7_0_OR_GREATER
133
122
[ GeneratedRegex ( @"^[^{{}}]*\{(.*?)\}/?$" , RegexOptions . None , CatchAllPathMilliseconds ) ]
134
123
private static partial Regex RegexCatchAllPath ( ) ;
135
- #else
136
- private static readonly Regex _regexCatchAllPath = RegexGlobal . New ( @"^[^{{}}]*\{(.*?)\}/?$" , RegexOptions . None , TimeSpan . FromMilliseconds ( CatchAllPathMilliseconds ) ) ;
137
- private static Regex RegexCatchAllPath ( ) => _regexCatchAllPath ;
138
- #endif
139
124
140
125
/// <summary>Check if the path template contains a Catch-All path parameter.
141
126
/// <para>It means that the path template ends with a placeholder and no other placeholders are present in the path template, without a question mark (query parameters).</para>
0 commit comments