This crate provides an Iterator
that scans a Read
looking for instances of a
Regex
delimiter, and yields the bytes between instances of the delimiter.
It is similar in purpose to
regex-chunker
, but differs in that
it does less (no async
, for example), so its implementation is simpler and
depends only on regex
.
cargo test
runs the tests, as usual. There is an example program,
src/bin/readme.rs, that is copied and adapted from the same program in the
regex-chunker
source repository. To run it:
cargo run --bin readme < some-file.txt
To compare the performance of this and other crates, you’ll want to build them in release mode:
cargo build --release --bin readme
time ./target/release/readme < some-file.txt
...
So far the performance of regex-splitter
and regex-chunker
seems comparable.