2 releases

0.1.1 May 1, 2016
0.1.0 Nov 8, 2015
Download history 953/week @ 2019-11-07 819/week @ 2019-11-14 1628/week @ 2019-11-21 589/week @ 2019-11-28 830/week @ 2019-12-05 982/week @ 2019-12-12 833/week @ 2019-12-19 1360/week @ 2019-12-26 1194/week @ 2020-01-02 1161/week @ 2020-01-09 2140/week @ 2020-01-16 2163/week @ 2020-01-23 1269/week @ 2020-01-30 1249/week @ 2020-02-06 1397/week @ 2020-02-13

3,725 downloads per month
Used in 10 crates (5 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