// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?im)^[0-9A-F]{32}$").unwrap();
let string = "fab4cc07260bc73302a2653aa2b0e6de
46cc38cc1039848dc287162cc4cf2532
a065c2cf24295a13725af9c5dc8cc76c
87d0f33c047915a0000ca972f3b32adc
43da9d5db71bedf3afc6f10fc8297a00
3fcca411d6774571a81a9faa4026c69a
9f36002354b2b75a069facac88ce5651
064ec24407084bf597c7dc1edc3f9017
3f5cfb400d72c7b3663b617368a0b3af";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/