diff --git a/src/AspNetCoreRateLimit.Redis/AspNetCoreRateLimit.Redis.csproj b/src/AspNetCoreRateLimit.Redis/AspNetCoreRateLimit.Redis.csproj
index 6d2b4a99..73195eb2 100644
--- a/src/AspNetCoreRateLimit.Redis/AspNetCoreRateLimit.Redis.csproj
+++ b/src/AspNetCoreRateLimit.Redis/AspNetCoreRateLimit.Redis.csproj
@@ -26,7 +26,7 @@
-
+
diff --git a/src/AspNetCoreRateLimit/Core/Extensions.cs b/src/AspNetCoreRateLimit/Core/Extensions.cs
index 160fb8c6..2b2be06b 100644
--- a/src/AspNetCoreRateLimit/Core/Extensions.cs
+++ b/src/AspNetCoreRateLimit/Core/Extensions.cs
@@ -27,7 +27,7 @@ public static bool IsRegexMatch(this string source, string value)
}
// if the regex is e.g. /api/values/ the path should be an exact match
// if all paths below this should be included the regex should be /api/values/*
- if (value[^1] != '$')
+ if (value[value.Length - 1] != '$')
{
value += '$';
}