2 releases

Uses old Rust 2015

0.1.1 May 1, 2016
0.1.0 Nov 8, 2015

#1179 in Algorithms

Download history 349707/week @ 2026-03-21 351835/week @ 2026-03-28 364964/week @ 2026-04-04 395286/week @ 2026-04-11 382564/week @ 2026-04-18 457797/week @ 2026-04-25 500354/week @ 2026-05-02 512865/week @ 2026-05-09 586763/week @ 2026-05-16 662254/week @ 2026-05-23 651333/week @ 2026-05-30 710301/week @ 2026-06-06 774620/week @ 2026-06-13 763888/week @ 2026-06-20 658641/week @ 2026-06-27 771551/week @ 2026-07-04

3,089,723 downloads per month
Used in 314 crates (25 directly)

MIT/Apache

15KB
172 lines

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));

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

No runtime deps