fn main() {
use fuzzy_regex::FuzzyRegex;
let re = FuzzyRegex::new(r"(?:\w+){e<=1}").unwrap();
// Find first match
let m = re.find("This is a tset").unwrap();
assert_eq!(m.as_str(), "tset");
// Find all matches
let matches: Vec<_> = re.find_iter("test tset tsat").collect();
assert_eq!(matches.len(), 3);
}
fn main() {
use fuzzy_regex::FuzzyRegex;
let re = FuzzyRegex::new("(?:needle){e<=1}").unwrap();
let mut stream = re.stream();
// Process in chunks
for m in stream.feed(b"some hay and niddle here") {
println!("Found: {} at {}", m.as_str(), m.start());
}
// Check position
assert_eq!(stream.position(), 24);
}