2 releases

Uses old Rust 2015

0.1.1 May 1, 2016
0.1.0 Nov 8, 2015
Download history 29225/week @ 2023-08-15 39386/week @ 2023-08-22 24356/week @ 2023-08-29 30122/week @ 2023-09-05 25733/week @ 2023-09-12 21953/week @ 2023-09-19 23635/week @ 2023-09-26 21642/week @ 2023-10-03 22400/week @ 2023-10-10 22660/week @ 2023-10-17 24322/week @ 2023-10-24 18477/week @ 2023-10-31 17876/week @ 2023-11-07 17744/week @ 2023-11-14 14914/week @ 2023-11-21 17316/week @ 2023-11-28

70,861 downloads per month
Used in 59 crates (15 directly)

MIT/Apache

15KB
172 lines

memmem

This is a crate for substring searching (with functionality similar to the memmem function in C). So far, it only contains a copy of the two-way search implementation from rust's standard library (but with an API that allows searching in &[u8]). Eventually, we plan to provide other searching algorithms, and possibly also some heuristics to choose a good searching algorithm based on the substring we are looking for.

Build status Coverage Status

Documentation


lib.rs:

A crate for string searching. The main trait is Searcher, which has a function for finding fixed things in long byte-strings. Currently, the only implementer of Searcher is TwoWaySearcher.

Example

use memmem::{Searcher, TwoWaySearcher};
let search = TwoWaySearcher::new("dog".as_bytes());
assert_eq!(search.search_in("The quick brown fox jumped over the lazy dog.".as_bytes()), Some(41));

No runtime deps