jeudi 25 mai 2023

How can I generate random strings in Rust that match a given regex pattern?

How to write a program in Rust that generates a random string that satisfies a given regular expression?

I expect the program to work for at least the following regular expressions.

"[^+*?]+"
"[^xu]"
"[^\\\\']"
"u{[0-9a-fA-F]+}"
".*"
"\\$[a-zA-Z_]\\w*"
"\\s"



Aucun commentaire:

Enregistrer un commentaire