Expand description
This crate is deprecated. Use crate memchr instead.
Fast substring search for strings and byte strings, using the two-way algorithm.
This is the same code as is included in Rust’s libstd that powers
str::find(&str), but here it is exposed with some improvements:
- Available for byte string searches using
&[u8] - Having an optional SSE4.2 accelerated version (if detected at runtime) which is even faster. Runtime detection requires the default std feature.
- Using
memchrfor the single byte case, which is ultra fast.
Functions§
- find_
bytes find_bytesfinds the first ocurrence ofpatternin thetext.- find_
str find_strfinds the first ocurrence ofpatternin thetext.- rfind_
bytes rfind_bytesfinds the last ocurrence ofpatternin thetext, and returns the index of the start of the match.- rfind_
str rfind_strfinds the last ocurrence ofpatternin thetextand returns the index of the start of the match.