Skip to main content

Module fuzzy

Module fuzzy 

Source

Structs§

Interval
匹配区间,表示 content 中匹配 target 的一段 [start, end)(左闭右开)

Functions§

fuzzy_match
大小写不敏感的子串匹配
get_match_intervals
获取 content 中所有匹配 target 的区间(大小写不敏感) 返回的区间为 [start, end),基于原始 content 的字节索引(保证在 char boundary 上)
highlight_matches
将 content 中匹配 target 的部分用 ANSI 绿色高亮 fuzzy = true 时使用大小写不敏感匹配,否则精确匹配