Registry / testing / rand-regex

rand-regex

JSON →
library0.19.0rscratesunverified

Generates random strings and byte strings matching a regex.

# Cargo.toml [dependencies] rand_regex = "0.19.0"
INSTALL
IMPORT
SIG · RAND-REGEX
R
rand-regex
testingrustv0.19.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Regex
use rand_regex::Regex;

Generates a random 5-letter lowercase string matching the regex.

use rand_regex::Regex; use rand::Rng; fn main() { let re = Regex::compile("[a-z]{5}", true).unwrap(); let mut rng = rand::thread_rng(); let s: String = rng.sample(re); println!("{}", s); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.19.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
rand-regex — cargo add rand-regex · libregistry