{"id":30326003,"url":"https://github.com/kthompson/glob","last_synced_at":"2025-10-18T21:36:37.359Z","repository":{"id":2124591,"uuid":"3067365","full_name":"kthompson/glob","owner":"kthompson","description":"A C# Glob library for .NET and .NET Core.","archived":false,"fork":false,"pushed_at":"2024-02-22T23:53:47.000Z","size":32693,"stargazers_count":225,"open_issues_count":8,"forks_count":23,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2025-08-01T04:12:33.246Z","etag":null,"topics":["c-sharp","directory-traversal","dotnet","dotnet-core","glob","glob-library"],"latest_commit_sha":null,"homepage":"https://kthompson.github.io/glob/","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/kthompson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2011-12-29T06:55:11.000Z","updated_at":"2025-06-17T14:12:07.000Z","dependencies_parsed_at":"2024-02-23T00:34:45.993Z","dependency_job_id":"cc272db3-ed5d-4c8a-b7aa-9cb695f97d2e","html_url":"https://github.com/kthompson/glob","commit_stats":{"total_commits":103,"total_committers":15,"mean_commits":6.866666666666666,"dds":0.5048543689320388,"last_synced_commit":"dc35a730114d0df6417eafa0f96c9d275b98472e"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/kthompson/glob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fglob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fglob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fglob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fglob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kthompson","download_url":"https://codeload.github.com/kthompson/glob/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fglob/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270713888,"owners_count":24633003,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c-sharp","directory-traversal","dotnet","dotnet-core","glob","glob-library"],"created_at":"2025-08-17T23:09:00.812Z","updated_at":"2025-10-18T21:36:32.335Z","avatar_url":"https://github.com/kthompson.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Glob\n\n[![Join the chat at https://gitter.im/kthompson/glob](https://badges.gitter.im/kthompson/glob.svg)](https://gitter.im/kthompson/glob?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Build status](https://img.shields.io/azure-devops/build/automaters/Glob/7/develop)](https://automaters.visualstudio.com/Glob/_build?definitionId=7\u0026branchFilter=51%2C51%2C51%2C51%2C51%2C51%2C51%2C51%2C51%2C51)\n[![Coverage](https://img.shields.io/azure-devops/coverage/automaters/Glob/7/develop)](https://automaters.visualstudio.com/Glob/_build?definitionId=7\u0026branchFilter=51%2C51%2C51%2C51%2C51%2C51%2C51%2C51%2C51%2C51)\n[![Tests](https://img.shields.io/azure-devops/tests/automaters/Glob/7/develop)](https://automaters.visualstudio.com/Glob/_build?definitionId=7\u0026branchFilter=51%2C51%2C51%2C51%2C51%2C51%2C51%2C51%2C51%2C51)\n[![Nuget](https://img.shields.io/nuget/v/glob.svg)](https://www.nuget.org/packages/Glob/)\n\n\nA C# Glob library for .NET.\n\n## What is a glob?\n\nA glob is a pattern-matching syntax that shells use.  Like when you do\n`rm *.cs`, the `*.cs` is a glob. \n\nSee: http://en.wikipedia.org/wiki/Glob_(programming) for more info.\n\n## Try it out!\n\nYou can test out Glob expressions using this library in your browser by visiting:\n\nhttps://kthompson.github.io/glob/\n\n\n[![image](https://user-images.githubusercontent.com/15068/129584238-9afa3196-e7a5-4a76-9c5e-0db0377d8ad9.png)](https://kthompson.github.io/glob/)\n\n## Supported Environments\n\n* Windows\n* Macintosh OS X (Darwin)\n* Linux\n\n## Features\n\n### Common Expressions\n\n| Pattern     | Description                                 |\n|-------------|---------------------------------------------|\n| taco*       | matches any string beginning with taco      |\n| \\*taco\\*    | matches any string containing taco          |\n| *taco       | matches any string ending in taco           |\n| *.[ch]      | matches any string ending in `.c` or `.h`   |\n| *.{gif,jpg} | match any string ending in `.gif` or `.jpg` |\n\n### Expressions\n\n| Pattern   | Description                                                                    |\n|-----------|--------------------------------------------------------------------------------|\n| *         | matches any number of characters including none, excluding directory separator |\n| ?         | matches a single character                                                     |\n| [abc]     | matches one character in the brackets                                          |\n| [!abc]    | matches any character not in the brackets                                      |\n| **        | match zero or more directories                                                 |\n| {abc,123} | comma delimited set of literals, matched 'abc' or '123'                        |\n\n### Other Features\n\n* Escape patterns are supported using `\\`\n* Pure C# implementation\n* No reliance on Regex\n* Simple text string matching support\n* File system matching APIs\n\n## Getting Started\n\n### Installing from NuGet\n\n```bash\ndotnet add package Glob\n```\n\n### Setup\n\nTo use Glob, you need to include the namespace:\n\n```csharp\nusing GlobExpressions;\n```\n\n### Example\n\n```csharp\nvar glob = new Glob(\"**/bin\");\nvar match = glob.IsMatch(@\"C:\\files\\bin\\\");\n```\n\n### Static Usage\n\n#### Single file\n\n```csharp\nvar match = Glob.IsMatch(@\"C:\\files\\bin\\\", \"**/bin\");\t\n```\n\n#### Files in a directory\n\n```csharp\nstring[] matchingFiles = Glob.Files(@\"C:\\files\\bin\\\", \"**/bin\").ToArray();\t\n```\n\n#### Directories in a directory\n\n```csharp\nstring[] matchingDirectories = Glob.Directories(@\"C:\\files\\bin\\\", \"**/bin\").ToArray();\t\n```\n\n## Extension Methods\n\n### DirectoryInfo.GlobDirectories\n\nEnumerate through all matching directories recursively.\n\n#### Params\n\n* pattern: String\n\n#### Example\n\n```csharp\nvar root = new DirectoryInfo(@\"C:\\\");\nvar allBinFolders = root.GlobDirectories(\"**/bin\");\n```\n\n### DirectoryInfo.GlobFiles\n\nEnumerate through all matching files recursively.\n\n#### Params\n\n* pattern: String\n\n#### Example\n\n```csharp\nvar root = new DirectoryInfo(@\"C:\\\");\nvar allDllFiles = root.GlobFiles(\"**/*.dll\");\n```\n\n### DirectoryInfo.GlobFileSystemInfos\n\nEnumerate through all matching files and folders recursively.\n\n#### Params\n\n* pattern: String\n\n#### Example\n\n```csharp\nvar root = new DirectoryInfo(@\"C:\\\");\nvar allInfoFilesAndFolders = root.GlobFileSystemInfos(\"**/*info\");\n```\n\n## Upgrading from 1.x\n\nIn 2.x all Glob expressions no longer support `\\` as path separators. Instead `/` should be used to separate paths in expressions. \nThe `/` path separator will still match on platform specific directory separators but `\\` is reserved for escape sequences.\n\n\n## Performance\n\n[See benchmarks](test/Glob.Benchmarks/BenchmarkDotNet.Artifacts/results/GlobExpressions.Benchmarks.GlobBenchmarks-report-github.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkthompson%2Fglob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkthompson%2Fglob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkthompson%2Fglob/lists"}