ktsu.TextFilter
1.5.3
Prefix Reserved
See the version list below for details.
dotnet add package ktsu.TextFilter --version 1.5.3
NuGet\Install-Package ktsu.TextFilter -Version 1.5.3
<PackageReference Include="ktsu.TextFilter" Version="1.5.3" />
<PackageVersion Include="ktsu.TextFilter" Version="1.5.3" />
<PackageReference Include="ktsu.TextFilter" />
paket add ktsu.TextFilter --version 1.5.3
#r "nuget: ktsu.TextFilter, 1.5.3"
#:package ktsu.TextFilter@1.5.3
#addin nuget:?package=ktsu.TextFilter&version=1.5.3
#tool nuget:?package=ktsu.TextFilter&version=1.5.3
ktsu.TextFilter
A .NET library for filtering text using glob patterns, regular expressions, and fuzzy matching
Introduction
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
Package Manager Console
Install-Package ktsu.TextFilter
.NET CLI
dotnet add package ktsu.TextFilter
Package Reference
<PackageReference Include="ktsu.TextFilter" Version="x.y.z" />
Usage Examples
Basic Example
using ktsu.TextFilter;
string text = "Hello, World!";
string pattern = "Hello*";
bool isMatch = TextFilter.Match(text, pattern);
Filtering Collections
using ktsu.TextFilter;
string[] texts = new string[] { "Hello, World!", "Goodbye, World!" };
string pattern = "Hello*";
IEnumerable<string> matches = TextFilter.Filter(texts, pattern);
Ranking Results
using ktsu.TextFilter;
string[] texts = new string[] { "Hello, World!", "Goodbye, World!" };
string pattern = "Hello";
IEnumerable<string> ranked = TextFilter.Rank(texts, pattern);
Advanced Usage
Match Options
You can customize how matching is performed using the MatchOptions enum:
using ktsu.TextFilter;
string text = "Hello beautiful world";
string pattern = "hello world";
// Match by any word in the pattern
bool anyWordMatch = TextFilter.Match(text, pattern, MatchOptions.AnyWord);
// Match by all words in the pattern
bool allWordsMatch = TextFilter.Match(text, pattern, MatchOptions.AllWords);
// Match the entire string
bool wholeStringMatch = TextFilter.Match(text, pattern, MatchOptions.WholeString);
Filter Types
TextFilter supports different filter types:
using ktsu.TextFilter;
string text = "Hello, World!";
string globPattern = "Hello*";
string regexPattern = "^Hello";
// Glob pattern matching
bool globMatch = TextFilter.Match(text, globPattern, filterType: FilterType.Glob);
// Regular expression matching
bool regexMatch = TextFilter.Match(text, regexPattern, filterType: FilterType.Regex);
// Fuzzy matching
bool fuzzyMatch = TextFilter.Match(text, "Helo", filterType: FilterType.Fuzzy);
API Reference
TextFilter Class
The primary class for text filtering operations.
Methods
| Name | Return Type | Description |
|---|---|---|
Match(string text, string pattern, MatchOptions options = MatchOptions.WholeString, FilterType filterType = FilterType.Glob) |
bool |
Tests if the input text matches the specified pattern |
Filter(IEnumerable<string> texts, string pattern, MatchOptions options = MatchOptions.WholeString, FilterType filterType = FilterType.Glob) |
IEnumerable<string> |
Returns all texts that match the pattern |
Rank(IEnumerable<string> texts, string pattern, MatchOptions options = MatchOptions.WholeString) |
IEnumerable<string> |
Returns texts ranked by how well they match the pattern |
Enums
MatchOptions
| Value | Description |
|---|---|
WholeString |
Match the entire string against the pattern |
AllWords |
Match all words in the pattern against the string |
AnyWord |
Match any word in the pattern against the string |
FilterType
| Value | Description |
|---|---|
Glob |
Use glob pattern matching |
Regex |
Use regular expression matching |
Fuzzy |
Use fuzzy matching |
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
- DotNet.Glob for glob pattern matching.
- ktsu.FuzzySearch for fuzzy matching.
| Product | Versions 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- DotNet.Glob (>= 3.1.3)
- ktsu.Extensions (>= 1.5.5)
- ktsu.FuzzySearch (>= 1.2.1)
-
net9.0
- DotNet.Glob (>= 3.1.3)
- ktsu.Extensions (>= 1.5.5)
- ktsu.FuzzySearch (>= 1.2.1)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on ktsu.TextFilter:
| Package | Downloads |
|---|---|
|
ktsu.ImGuiWidgets
A library of custom widgets using ImGui.NET and utilities to enhance ImGui-based applications. |
|
|
ktsu.ImGuiPopups
A library for custom popups using ImGui.NET. |
|
|
ktsu.ImGui.Popups
A professional library for modal dialogs and popup components in ImGui.NET, providing message boxes, input prompts with validation (string, int, float), searchable selection lists with type-safe generics, and an advanced filesystem browser with open/save modes, directory navigation, and pattern filtering support. |
|
|
ktsu.ImGui.Widgets
A comprehensive library of custom widgets and UI components for ImGui.NET, featuring radial progress bars with countdown/count-up timers, tabbed interfaces with drag-and-drop support, type-safe combo boxes, resizable divider containers, powerful search boxes with fuzzy matching, icons with event handling, flexible grid layouts, and scoped utilities for IDs and disabling elements. |
|
|
ktsu.PkmnDB
PkmnDB |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.10-pre.1 | 57 | 2/17/2026 |
| 1.5.9 | 177 | 2/16/2026 |
| 1.5.9-pre.1 | 56 | 2/16/2026 |
| 1.5.8 | 96 | 2/14/2026 |
| 1.5.7 | 99 | 2/14/2026 |
| 1.5.7-pre.7 | 53 | 2/6/2026 |
| 1.5.7-pre.6 | 57 | 2/5/2026 |
| 1.5.7-pre.5 | 55 | 2/3/2026 |
| 1.5.7-pre.4 | 59 | 2/1/2026 |
| 1.5.7-pre.3 | 53 | 1/31/2026 |
| 1.5.7-pre.2 | 55 | 1/31/2026 |
| 1.5.7-pre.1 | 50 | 1/31/2026 |
| 1.5.6 | 134 | 1/30/2026 |
| 1.5.5 | 103 | 1/28/2026 |
| 1.5.5-pre.4 | 152 | 11/24/2025 |
| 1.5.5-pre.3 | 139 | 11/23/2025 |
| 1.5.5-pre.2 | 121 | 11/23/2025 |
| 1.5.5-pre.1 | 137 | 11/23/2025 |
| 1.5.4 | 2,194 | 8/26/2025 |
| 1.5.3 | 1,019 | 5/21/2025 |
## v1.5.3
Initial release or repository with no prior history.