Rust regex crate

Rust regex crate

github.com

3

About this website

The Rust regex crate is the standard regular expression library for the Rust programming language, maintained by the Rust team and contributors led by Andrew Gallant (BurntSushi). With over 4,000 stars as of 2026, it is one of the most performance-optimized regex engines available in any programming language, consistently ranking at or near the top of benchmarks for regex search speed. Key features include: linear time guarantee for all inputs (no catastrophic backtracking, the regex engine is guaranteed to run in O(n) time where n is the length of the input text), Unicode support enabled by default (character classes like \w, \d, \s match Unicode characters, case-insensitive matching follows Unicode simple case folding), support for common regex syntax including character classes, repetition quantifiers, alternation, grouping, backreferences (in the regex crate version using the Fancy Regex wrapper), anchors, word boundaries, and capture groups, named capture groups via (?P<name>pattern), look-around assertions in the fancy-regex crate, replace and replace_all methods with named capture interpolation, split methods for tokenizing strings, find_iter for iterating over all matches, captures_iter for iterating over capture groups, multiple regex compilation with RegexSet (searching multiple patterns simultaneously in a single pass), configurable options including case-insensitive mode, multi-line mode, dot-matches-newline, swap greed, and Unicode mode, a CLI tool (rg or ripgrep) that uses this crate for ultra-fast file searching, and SIMD-accelerated implementations for x86-64 (SSE2, SSE4.2, AVX2) and AArch64 (NEON) architectures. The crate uses lazy DFA (Deterministic Finite Automaton) construction for fast matching and falls back to NFA simulation for features that DFA cannot handle.

Tags & Categories

Statistics

3
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!