Migration Guide
Migrating from other libraries to fuzzy-regex.
From regex (standard)
fuzzy-regex extends the standard regex crate with fuzzy matching:
fn main() {
// Standard regex
let re = regex::new("hello").unwrap();
// fuzzy-regex
let re = fuzzy_regex::FuzzyRegex::new("hello").unwrap();
// Add fuzziness
let re = fuzzy_regex::FuzzyRegex::new("(?:hello){e<=1}").unwrap();
println!("Created");
}
From fuzzy-aho-corasick
See Compatibility Layer for a drop-in replacement.
From mrab-regex
The fuzzy syntax is compatible:
fn main() {
// mrab-regex
let _re = regex::new(r"(?i)(?:hello){e<=1}");
// fuzzy-regex (same syntax)
let re = fuzzy_regex::FuzzyRegex::new(r"(?i)(?:hello){e<=1}").unwrap();
println!("Created");
}