{"id":22835187,"url":"https://github.com/jchristn/urlmatcher","last_synced_at":"2025-04-24T00:07:53.692Z","repository":{"id":65413640,"uuid":"341267845","full_name":"jchristn/UrlMatcher","owner":"jchristn","description":"Simple URL matcher library allowing you to match based on explicit string or parameters","archived":false,"fork":false,"pushed_at":"2025-01-07T14:52:06.000Z","size":839,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T00:07:42.179Z","etag":null,"topics":["csharp","dotnet","dotnet-core","match","nuget","url"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchristn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-22T16:41:49.000Z","updated_at":"2025-03-26T20:12:07.000Z","dependencies_parsed_at":"2023-01-23T10:55:03.743Z","dependency_job_id":null,"html_url":"https://github.com/jchristn/UrlMatcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FUrlMatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FUrlMatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FUrlMatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FUrlMatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchristn","download_url":"https://codeload.github.com/jchristn/UrlMatcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535099,"owners_count":21446508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","dotnet-core","match","nuget","url"],"created_at":"2024-12-12T22:08:38.391Z","updated_at":"2025-04-24T00:07:53.671Z","avatar_url":"https://github.com/jchristn.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![alt tag](https://github.com/jchristn/urlmatcher/blob/main/assets/icon.ico)\n\n# UrlMatcher\n\n[![NuGet Version](https://img.shields.io/nuget/v/UrlMatcher.svg?style=flat)](https://www.nuget.org/packages/UrlMatcher/) [![NuGet](https://img.shields.io/nuget/dt/UrlMatcher.svg)](https://www.nuget.org/packages/UrlMatcher) \n\nSimple URL matcher library allowing you to match based on explicit string or parameters, targeted to .NET Core, .NET Standard, and .NET Framework.\n\n## Help or Feedback\n\nFirst things first - do you need help or have feedback?  File an issue here!  We'd love to hear from you.\n\n## New in v3.0.0\n\n- Refactor to support both static methods and instances\n- Instances take either a `Uri` or `string` (URL)\n\n## It's Really Easy...  I Mean, REALLY Easy\n\nRefer to the ```Test``` project for a working example.\n\n### Simple Static Method\n\nUse the static method when you need to compare an input URL against a pattern once.\n\n```csharp\nusing UrlMatcher;\n\nstring pattern = \"/{version}/users/{userId}\";\nNameValueCollection vals = null;\n\nif (Matcher.Match(\"/v1.0/users/42\", pattern, out vals))\n{\n  Console.WriteLine(\"Match!\");\n  Console.WriteLine(\"  version : \" + vals[\"version\"]);  // v1.0\n  Console.WriteLine(\"  userId  : \" + vals[\"userId\"]);   // 42\n}\nelse\n{\n  Console.WriteLine(\"No match\");\n}\n```\n\n### Instance Method\n\nInstantiate the class by supplying the URI or URL.  Using the instance method eliminates the need to repeatedly parse the input URI or URL.\n\n```csharp\nusing UrlMatcher;\n\nMatcher matcher = new Matcher(\"/v1.0/users/42\");\nNameValueCollection vals = null;\n\nif (matcher.Match(\"/{version}/users/{userId}\"))          // do something\nelse if (matcher.Match(\"/{version}/hobbies/{hobbyId}\"))  // do something\nelse\n{\n  Console.WriteLine(\"No match\");\n}\n```\n\n## Version History\n\nPlease refer to CHANGELOG.md.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristn%2Furlmatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchristn%2Furlmatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristn%2Furlmatcher/lists"}