BurntSushi / regex-automata

A low level regular expression library that uses deterministic finite automata.
The Unlicense
351 stars 26 forks source link

Add DFA::{find_iter, rfind_iter} for working on iterators. #10

Closed s3bk closed 3 years ago

s3bk commented 3 years ago

One does not always have a slice of data to work with. find_iter and rfind_iter provide a loophole to use iterators instead.

BurntSushi commented 3 years ago

Thanks, but this is not the right API. Moreover, this crate is currenrly undergoing a rewrite and supporting streaming in the rewrite is a little more challenging.

The main problem with this API is that an iterator that yields single bytes makes it impossible to use fast prefilters (which exist in the rewrite).

If you need to support streaming, I urge you to write it yourself in your own project. That's exactly why low level DFA transition functions are exposed. So that you can walk the DFA in any way you want.

BurntSushi commented 3 years ago

In general, before making API additions, please discuss them first before submitting a PR.