Glob.cs 5.1.1643

Glob.cs

Version Build status codecov.io netstandard2.0 net461

Single-source-file path globbing for .NET (netstandard2.0 and net461).

Features

  • Choose case sensitivity
  • Optionally match only directories
  • Injectable file system implementation for easy testing (uses System.IO.Abstractions)
  • Can cancel long running match
  • Throw or continue on file system errors
  • Optionally log errors to supplied log implementation
  • Lazy tree traversal
  • Option to limit depth of ** expansion

Syntax

  • ? matches a single character
  • * matches zero or more characters
  • ** matches zero or more recursive directories, e.g. a\**\x matches a\x, a\b\x, a\b\c\x, etc.
  • [...] matches a set of characters, syntax is the same as character groups in Regex.
  • {group1,group2,...} matches any of the pattern groups. Groups can contain groups and patterns, e.g. {a\b,{c,d}*}.

Usage

Install the NuGet package Glob.cs. Then:

var dlls = Glob.Expand(@"c:\windows\system32\**\*.dll");

No packages depend on Glob.cs.

.NET Framework 4.6.1

.NET Standard 2.0

Version Downloads Last updated
5.1.1643 14 01/25/2025
5.1.1625 17 01/08/2025
5.1.1491 37 02/23/2024
5.1.1490 34 02/20/2024
5.1.1253 34 11/28/2023
5.1.1198 34 12/13/2023
5.1.766 34 12/19/2023
5.0.224 30 12/18/2023
4.0.166 35 01/11/2024
4.0.37 38 12/22/2023
3.0.27 32 02/20/2024
3.0.26 41 12/10/2023
3.0.25 42 12/22/2023
2.1.21 29 02/20/2024
2.0.13 30 12/09/2023
2.0.8 30 12/24/2023
1.3.0 36 01/22/2024
1.2.0 30 12/10/2023
1.1.0 29 01/27/2024
1.0.0 31 12/09/2023