Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pattern Syntax

fuzzy-regex supports standard regex syntax plus fuzzy matching.

Quick Reference

SyntaxDescription
aLiteral character
.Any character except newline
\dDigit [0-9]
\DNon-digit
\wWord character [a-zA-Z0-9_]
\WNon-word character
\sWhitespace
\SNon-whitespace
[abc]Character class
[^abc]Negated class
[a-z]Range
^Start of string
$End of string
\bWord boundary
\BNon-word boundary

Escaping

Special characters that need escaping: .^$*+?{}[]\\|()

fn main() {
    use fuzzy_regex::FuzzyRegex;

    // Match literal dot
    let re = FuzzyRegex::new(r"file\.txt").unwrap();

    // Match literal backslash
    let re2 = FuzzyRegex::new(r"path\\to\\file").unwrap();
    
    println!("dot match: {}", re.is_match("file.txt"));
    println!("backslash match: {}", re2.is_match(r"path\to\file"));
}