ktsu.TextFilter 1.1.5-pre.3

Prefix Reserved
This is a prerelease version of ktsu.TextFilter.
There is a newer version of this package available.
See the version list below for details.
dotnet add package ktsu.TextFilter --version 1.1.5-pre.3                
NuGet\Install-Package ktsu.TextFilter -Version 1.1.5-pre.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ktsu.TextFilter" Version="1.1.5-pre.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ktsu.TextFilter --version 1.1.5-pre.3                
#r "nuget: ktsu.TextFilter, 1.1.5-pre.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ktsu.TextFilter as a Cake Addin
#addin nuget:?package=ktsu.TextFilter&version=1.1.5-pre.3&prerelease

// Install ktsu.TextFilter as a Cake Tool
#tool nuget:?package=ktsu.TextFilter&version=1.1.5-pre.3&prerelease                

ktsu.TextFilter

ktsu.TextFilter is a .NET library that provides methods for filtering text based on different filter types and match options. It supports glob patterns, regular expressions, and fuzzy matching to help you efficiently filter and search through collections of strings.

Features

  • Glob Pattern Matching: Filter text using glob patterns with optional, required, and excluded tokens.
  • Regular Expression Matching: Filter text using regular expressions.
  • Fuzzy Matching: Rank text based on how well it matches a fuzzy pattern.
  • Customizable Match Options: Match by whole string, all words, or any word.

Installation

To install TextFilter, add the following NuGet packages to your project:

dotnet add package ktsu.TextFilter

Usage

Matching Text

You can match a single string against a pattern using the Match method.

using ktsu.TextFilter;

string text = "Hello, World!";
string pattern = "Hello*";

bool isMatch = TextFilter.Match(text, pattern);

Filtering Text

You can filter a collection of strings using the Filter method.

using ktsu.TextFilter;

string[] texts = new string[] { "Hello, World!", "Goodbye, World!" };
string pattern = "Hello*";

IEnumerable<string> matches = TextFilter.Filter(texts, pattern);

Ranking Text

You can rank a collection of strings based on how well they match a fuzzy pattern using the Rank method.

using ktsu.TextFilter;

string[] texts = new string[] { "Hello, World!", "Goodbye, World!" };
string pattern = "Hello";

IEnumerable<string> ranked = TextFilter.Rank(texts, pattern);

Contributing

Contributions are welcome! For feature requests, bug reports, or questions, please open an issue on GitHub. If you would like to contribute code, please open a pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Contact

For any questions or inquiries, please contact the project maintainers.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ktsu.TextFilter:

Package Downloads
ktsu.ImGuiPopups

A library for custom popups using ImGui.NET.

ktsu.PkmnDB

PkmnDB

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.2-pre.7 0 1/10/2025
1.3.2-pre.6 0 1/10/2025
1.3.2-pre.5 1 1/8/2025
1.3.2-pre.4 34 1/7/2025
1.3.2-pre.3 43 1/5/2025
1.3.2-pre.2 60 1/3/2025
1.3.2-pre.1 44 1/3/2025
1.3.1 113 1/3/2025
1.3.0 67 1/3/2025
1.2.0 70 1/3/2025
1.1.5 137 12/27/2024
1.1.5-pre.7 48 1/3/2025
1.1.5-pre.6 44 1/2/2025
1.1.5-pre.5 60 12/31/2024
1.1.5-pre.4 38 12/30/2024
1.1.5-pre.3 42 12/29/2024
1.1.5-pre.2 36 12/28/2024
1.1.5-pre.1 38 12/27/2024
1.1.4-pre.1 37 12/27/2024
1.1.3-pre.1 38 12/27/2024
1.1.2-pre.1 41 12/27/2024
1.1.1 90 12/26/2024
1.1.0 86 12/26/2024
1.0.19 235 12/26/2024
1.0.18 70 12/26/2024
1.0.17 74 12/26/2024
1.0.16 83 12/26/2024
1.0.15 74 12/26/2024
1.0.14 79 12/26/2024
1.0.13 82 12/26/2024
1.0.12 76 12/25/2024
1.0.11 223 12/23/2024
1.0.10 102 12/23/2024
1.0.9 80 12/23/2024
1.0.8 81 12/22/2024
1.0.7 74 12/22/2024
1.0.6 71 12/22/2024
1.0.5 74 12/22/2024
1.0.4 77 12/22/2024
1.0.3 79 12/22/2024
1.0.2 129 12/22/2024
1.0.1 168 12/19/2024
1.0.0 90 12/19/2024

##