Package for matching paths (files, directories) using the apache ant-style.
- .NET Framework 2.0
Install the NuGet package using the command below:
Install-Package AntPathMatching
...or search for "AntPathMatching
" in the NuGet index.
The code below is an example how to use the library.
using AntPathMatching;
...
var ant = new Ant("/assets/**/*.{js,css}");
var isMatch = ant.IsMatch("/assets/scripts/vendor/angular.js");
using AntPathMatching;
...
var ant = new Ant("/assets/**/*.js");
var antDir = new AntDirectory(ant);
var matchingFiles = ant.SearchRecursively("C:\directory\", includeDirectoryPath: false);
using AntPathMatching;
...
constructor(
IAntFactory antFactory,
IAntDirectoryFactory antDirectoryFactory
) {
var ant = antFactory.CreateNew("/assets/**/*.js");
var antDir = antDirectoryFactory.CreateNew(ant);
}