#pattern-matching #search-pattern #simd #data #iterator #compatible #scan

nightly patterns

no_std compatible pattern scan library using simd

9 releases

0.2.5 Dec 28, 2023
0.2.4 Dec 27, 2023
0.2.1 Apr 10, 2023
0.1.4 Apr 8, 2023

#1619 in Text processing

Download history 13/week @ 2024-09-23

72 downloads per month

MIT/Apache

12KB
203 lines

Pattern matching library

Allows you to search for a pattern within data via an iterator interface.

This library uses the core::simd abstraction and does not allocate.

Usage

use patterns::Pattern;

let data = [0_u8; 1_000_00];
// Allows . and ? as wildcard.
// Any number of wildcard characters between spaces is considered a wildcard byte.
let pattern: Pattern = "01 02 00 ? 59 ff".parse().unwrap();
let mut iterator = pattern.matches(&data);

for _found in iterator {
    // use _found
}

lib.rs:

Pattern matching library

Allows you to search for a pattern within data via an iterator interface. This library uses the core::simd abstraction and does not allocate.

Usage

use patterns::Pattern;

let data = [0_u8; 1_000_00];
// Allows . and ? as wildcard.
// Any number of wildcard characters between spaces is considered a wildcard byte.
let pattern: Pattern = "01 02 00 ? 59 ff".parse().unwrap();
let mut iterator = pattern.matches(&data);

for _found in iterator {
    // use _found
}

No runtime deps