lure
Safe & Efficient Regex in Rust – Compile-Time Validation & Single Compilation
This crate contains a macro to generate a lazy
Regex and perform regex validation.
The code fails to compile if the regex is invalid.
Usage
This Rust crate helps prevent common pitfalls when working with regular expressions by ensuring patterns are valid at compile time and avoiding redundant compilations. It leverages the standard library OnceCell to compile regexes only once and uses a procedural macro for compile-time validation, improving both safety and performance.
The only dependency in the crate if regex
Example:
use regex;
// Password regex
let re = regex!;
assert!;
License
Licensed under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)