Skip to content
Library for matching ant style paths, written in CSharp.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AntPathMatching.Tests inject IFileSystem into AntDirectory Sep 21, 2018
AntPathMatching
.gitignore
AntPathMatching.sln Fixes spelling mistake "patch" => "path" in folders Feb 5, 2017
LICENSE
README.md
icon.png

README.md

Ant Path Matching

Build status NuGet Join the chat at https://gitter.im/ant-path-matching/Lobby

Package for matching paths (files, directories) using the apache ant-style.

Prerequisites

  • .NET Framework 2.0

Installation

Install the NuGet package using the command below:

Install-Package AntPathMatching

...or search for "AntPathMatching" in the NuGet index.

Getting started

The code below is an example how to use the library.

Standalone match

using AntPathMatching;
...
var ant = new Ant("/assets/**/*.{js,css}");
var isMatch = ant.IsMatch("/assets/scripts/vendor/angular.js");

Recursive match

using AntPathMatching;
...
var ant = new Ant("/assets/**/*.js");
var antDir = new AntDirectory(ant);
var matchingFiles = ant.SearchRecursively("C:\directory\", includeDirectoryPath: false);

Dependency Injection

using AntPathMatching;
...
constructor(
	IAntFactory antFactory,				
	IAntDirectoryFactory antDirectoryFactory
) {
	var ant = antFactory.CreateNew("/assets/**/*.js");
	var antDir = antDirectoryFactory.CreateNew(ant);
}
You can’t perform that action at this time.