2 releases

Uses old Rust 2015

0.1.1 May 1, 2016
0.1.0 Nov 8, 2015
Download history 6140/week @ 2021-08-18 5935/week @ 2021-08-25 5559/week @ 2021-09-01 6551/week @ 2021-09-08 6419/week @ 2021-09-15 7180/week @ 2021-09-22 7320/week @ 2021-09-29 8017/week @ 2021-10-06 7552/week @ 2021-10-13 6410/week @ 2021-10-20 5608/week @ 2021-10-27 6589/week @ 2021-11-03 4462/week @ 2021-11-10 4291/week @ 2021-11-17 3543/week @ 2021-11-24 3466/week @ 2021-12-01

16,923 downloads per month
Used in 55 crates (12 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

T%W