Crate features / regex
Feature flags · regex 1.13.1 · from crates.io 2026-10-24
regex features: what each one does, and the line to copy
Short answerregex 1.13.1 has 21 features. By default it turns on std, perf, unicode, regex-syntax/default; add default-features = false to start from nothing. It needs Rust 1.65 or newer.
Pick features
Every feature
| Feature | In default | Turns on |
|---|---|---|
logging | aho-corasick?/logging, memchr?/logging, regex-automata/logging | |
pattern | nothing else (a switch the code checks) | |
perf | yes | perf-cache, perf-dfa, perf-onepass, perf-backtrack, perf-inline, perf-literal |
perf-backtrack | regex-automata/nfa-backtrack | |
perf-cache | nothing else (a switch the code checks) | |
perf-dfa | regex-automata/hybrid | |
perf-dfa-full | regex-automata/dfa-build, regex-automata/dfa-search | |
perf-inline | regex-automata/perf-inline | |
perf-literal | dep:aho-corasick, dep:memchr, regex-automata/perf-literal | |
perf-onepass | regex-automata/dfa-onepass | |
std | yes | aho-corasick?/std, memchr?/std, regex-automata/std, regex-syntax/std |
unicode | yes | unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment, regex-automata/unicode, regex-syntax/unicode |
unicode-age | regex-automata/unicode-age, regex-syntax/unicode-age | |
unicode-bool | regex-automata/unicode-bool, regex-syntax/unicode-bool | |
unicode-case | regex-automata/unicode-case, regex-syntax/unicode-case | |
unicode-gencat | regex-automata/unicode-gencat, regex-syntax/unicode-gencat | |
unicode-perl | regex-automata/unicode-perl, regex-automata/unicode-word-boundary, regex-syntax/unicode-perl | |
unicode-script | regex-automata/unicode-script, regex-syntax/unicode-script | |
unicode-segment | regex-automata/unicode-segment, regex-syntax/unicode-segment | |
unstable | pattern | |
use_std | std |
dep:x turns on the optional dependency x; x/y turns on feature y of dependency x (with ?, only if x is already on).
MSRV history
The minimum Rust version regex declares (rust-version), and the release that changed it:
- 1.8.0 (2023-04-20): Rust 1.60.0
- 1.10.0 (2023-10-09): Rust 1.65
Stuck on an older compiler? Pin the last version that supports it, for example cargo update -p regex --precise <version>, or use resolver 3, which picks compatible versions for you.
More on regex
Real downloads, dependents and alternatives: regex crate data (3.4M real downloads a day, 24,288 dependents).
Security record: regex advisories.
docs.rs feature list · crates.io · license MIT OR Apache-2.0 · edition 2021
Up next
Before you depend on itregex crate dataReal downloads, dependents, alternatives.Read it next →Did this answer your question?