Expand description
Unicode-aware text search utilities.
Feature-gated behind the normalization feature flag for normalization-aware
and case-folded search. Basic exact search is always available.
§Policy-Aware Search
When the normalization feature is enabled, [search_with_policy] provides a
unified entry point that combines configurable normalization form, case folding,
and width measurement into a single [SearchPolicy]. Results include display
column offsets computed under the chosen WidthMode.
§Example
use ftui_text::search::{SearchResult, search_exact};
let results = search_exact("hello world hello", "hello");
assert_eq!(results.len(), 2);
assert_eq!(results[0].range, 0..5);
assert_eq!(results[1].range, 12..17);Structs§
- Search
Result - A single search match with its byte range in the source text.
Enums§
- Width
Mode - Unicode character width measurement mode for search results.
Functions§
- display_
col_ at - Compute the display column at a byte offset in a string.
- search_
ascii_ case_ insensitive - Case-insensitive search using simple ASCII lowering.
- search_
exact - Find all exact substring matches (byte-level, no normalization).
- search_
exact_ overlapping - Find all exact substring matches, allowing overlapping results.