Skip to main content

Module search

Module search 

Source
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.

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§

SearchResult
A single search match with its byte range in the source text.

Enums§

WidthMode
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.