9 releases (stable)
1.0.5 | Dec 3, 2023 |
---|---|
1.0.4 | Sep 9, 2023 |
1.0.2 | Aug 9, 2023 |
0.1.2 | Aug 9, 2023 |
#96 in Value formatting
46 downloads per month
39KB
577 lines
🔮 Write readable regular expressions
The crate provides a clean and readable way of writing your regex in the Rust programming language:
Without |
With |
|
|
|
|
|
|
How to use the crate?
To convert a PrettyRegex
into a regex from regex
crate, you can call to_regex
or to_regex_or_panic
:
use pretty_regex::digit;
let regex = (digit() + ascii_alphabetic().optional()).to_regex_or_panic();
assert!(regex.is_match("3"));
Dependencies
~2.2–3MB
~54K SLoC