Skip to content

noncombatant/regex-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regex-splitter

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.

Building And Running

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.

About

An `Iterator` that yields `Vec<u8>`s from `Read`s, delimited by regular expressions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages