Cloudtoid.UrlPattern
1.0.35
dotnet add package Cloudtoid.UrlPattern --version 1.0.35
NuGet\Install-Package Cloudtoid.UrlPattern -Version 1.0.35
<PackageReference Include="Cloudtoid.UrlPattern" Version="1.0.35" />
<PackageVersion Include="Cloudtoid.UrlPattern" Version="1.0.35" />
<PackageReference Include="Cloudtoid.UrlPattern" />
paket add Cloudtoid.UrlPattern --version 1.0.35
#r "nuget: Cloudtoid.UrlPattern, 1.0.35"
#:package Cloudtoid.UrlPattern@1.0.35
#addin nuget:?package=Cloudtoid.UrlPattern&version=1.0.35
#tool nuget:?package=Cloudtoid.UrlPattern&version=1.0.35
Cloudtoid.UrlPattern
Match URL paths and extract named values with readable patterns. Supports prefix and exact matching, optional sections, wildcards, and regular expressions. Compiled patterns are cached for reuse.
Install
Requires .NET 10 or later.
dotnet add package Cloudtoid.UrlPattern
Example
using Cloudtoid.UrlPattern;
var engine = new PatternEngine();
var match = engine.Match(
pattern: "exact: /category/:category/product/:product",
path: "/category/furniture/product/black-couch");
Console.WriteLine(match.Variables["category"]); // furniture
Console.WriteLine(match.Variables["product"]); // black-couch
Pass the URL path only, starting with /; exclude the scheme, host, query string, and fragment. Match throws when matching fails; use TryMatch to handle a non-match without an exception.
Pattern syntax
:namecaptures a named value.*matches characters within a path segment, excluding/.- Parentheses mark optional sections, such as
/products(/:id). exact:requires the entire path to match.prefix:matches a prefix and is the default mode.regex:enables regular expressions with named captures.
For dependency injection, call services.AddUrlPattern() and inject IPatternEngine.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Cloudtoid.Framework (>= 1.0.123)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.13)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.35 | 84 | 9/12/2026 |
| 1.0.34 | 82 | 9/12/2026 |
| 1.0.33 | 36,769 | 2/8/2023 |
| 1.0.32 | 903 | 11/20/2022 |
| 1.0.31 | 520 | 11/20/2022 |
| 1.0.30 | 614 | 7/11/2021 |
| 1.0.29 | 532 | 6/17/2021 |
| 1.0.28 | 640 | 8/26/2020 |
| 1.0.27 | 694 | 8/26/2020 |
| 1.0.26 | 676 | 8/17/2020 |
| 1.0.25 | 28,762 | 5/13/2020 |
| 1.0.24 | 723 | 5/12/2020 |
| 1.0.23 | 739 | 4/13/2020 |
| 1.0.22 | 709 | 4/7/2020 |
| 1.0.21 | 734 | 4/7/2020 |
| 1.0.20 | 748 | 4/7/2020 |
| 1.0.19 | 790 | 4/6/2020 |
| 1.0.18 | 742 | 4/6/2020 |
| 1.0.17 | 732 | 4/6/2020 |
| 1.0.16 | 769 | 4/6/2020 |