- Advanced Wildcard Matching:
- Supports wildcards (
*and**) for flexible directory and file searches. (e.g.,a\**\).
- Supports wildcards (
- Parent Traversal:
- Use
..to navigate to the parent directory and...to recursively traverse all parent directories.
- Use
- Exact Matching:
- Match specific directories by name.
- Tagged Search:
- Identify directories containing a marker file or subdirectory. (e.g.,
a\:tagged(.marker)\b).
- Identify directories containing a marker file or subdirectory. (e.g.,
- Composable Expressions:
- Combine strategies for complex path resolutions, such as
...\\**\\kxd.
- Combine strategies for complex path resolutions, such as
- Plugins:
- Extend functionality with custom path resolvers and matchers.
WildPath is available as a NuGet package. You can install it using the .NET CLI or through the NuGet Package Manager in Visual Studio.
dotnet add package WildPathInstall-Package WildPathAlternatively, you can clone the repository and build the project manually:
- Clone the repository:
git clone https://github.com/JKamsker/WildPath.git- Build the project using your favorite IDE or CLI:
dotnet buildFor more details, visit the NuGet package page.
using WildPath;
var result = PathResolver.Resolve("SubDir1\\SubSubDir1");
Console.WriteLine(result);
// Output (assuming current directory = "C:\\Test"): "C:\\Test\\SubDir1\\SubSubDir1"Find a directory named kxd:
var result = PathResolver.Resolve("...\\**\\kxd");
// Output: "C:\\Test\\SubDir1\\SubSubDir1\\bin\\Debug\\kxd"Find a directory containing .marker and a specific subpath:
var result = PathResolver.Resolve("**\\:tagged(.marker):\\bin\\Debug");
// Output: "C:\\Test\\SubDir2\\SubSubDir1\\bin\\Debug"To use a custom current directory, separator or even a different file system, you can new up a PathResolver and use the same API:
using WildPath;
var currentDir = "C:\\Test";
var expression = "SubDir1\\SubSubDir1";
var resolver = new PathResolver(currentDir);
var result = resolver.Resolve(expression);
Console.WriteLine(result); // Output: "C:\\Test\\SubDir1\\SubSubDir1"Here you can find an example of how to create and use a custom plugin.
| Symbol | Description |
|---|---|
* |
Matches any single directory name. |
** |
Matches directories recursively. |
.. |
Moves to the parent directory. |
... |
Recursively traverses all parent directories. |
:tagged(x) |
Matches directories containing a file or folder named x. |
Run the test suite to validate functionality:
dotnet testExample tests include:
- Wildcard and parent traversal.
- Directory matching with markers.
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes and push to your fork:
git commit -m "Description of feature" git push origin feature-name - Submit a pull request.
...{1,3}\\**{1,3}\\:tagged(testhost.exe):\\frshould only search 1-3 directories deep....{4}\\**{4}\\:tagged(testhost.exe):\\frshould only search 4 directories deep.
Like seriously, this libaray begs for being ddosed.
Be a little cray cray
...\\**\\:content(test.json, test):should search for files containing the string "test".
...\\**\\:zip(test.zip):\\frshould search for files within a zip file named "test.zip".
This project is licensed under the MIT License.

