Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Glob in CSharp

AppVeyor

Glob1 patterns specify sets of fienames with wildcard characters.

This is a glob implementation in CSharp. It heavily dependents on the Glob class defined in Glob.cs, which is the Glob implemenation of Ruby programming language for .NET Framework.

Usage

varresults=Glob.GetMatches(input,0);

Rules

  1. * Matches 0 or more characters of the file name or directory name.
  2. ? Matches any single character of the file name or directory name.
  3. ** Recursively matches all the current and descendant directories.
  4. {} Allows for a comma-separated list of OR expressions.
  5. [...] Matches a range of characters, similar to a RegExp range.

##Samples Folder Structure

|-- AAA.txt
|-- ABB.txt
|-- ABC.txt
|-- DDD
|-- AAA.txt
|-- BBB.txt

Result

PatternResult
AAA.txtAAA.txt
A*.txtAAA.txt, ABB.txt, ABC.txt
AB?.txtABB.txt, ABC.txt
*AAA.txt, ABB.txt, ABC.txt, DDD
**AAA.txt, ABB.txt, ABC.txt, DDD
**/*Returns all the files and directories recursively
**/DDD/
**/{AAA,BBB}*AAA.txt, DDD/AAA.txt, DDD/BBB.txt

About

Implement glob matching in csharp

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages