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.
var results = Glob.GetMatches(input, 0);
*
Matches 0 or more characters of the file name or directory name.?
Matches any single character of the file name or directory name.**
Recursively matches all the current and descendant directories.{}
Allows for a comma-separated list of OR expressions.[...]
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
Pattern | Result |
---|---|
AAA.txt |
AAA.txt |
A*.txt |
AAA.txt, ABB.txt, ABC.txt |
AB?.txt |
ABB.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 |