// 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#"(?m)(?!(value|id)(\":\s\"|':\su'))\b[a-fA-F\d]{32}"#).unwrap();
let string = "\"value\": \"ef51be4506d7d287abc8c26ea6c495f6\", \"u_jira_status\": \"\", \"u_quarter_closed\": \"\", \"file_hash\": \"ef51be4506d7d287abc8c26ea6c495f6\", \"escalation\": \"0\", \"upon_approval\": \"proceed\", \"correlation_id\": \"ef51be4506d7d287abc8c26ea6c495f6\", \"cyber_kill_change\": \"ef51be4506d7d287abc8c26ea6c495f6\", \"sys_id\": \"ef51be4506d7d287abc8c26ea6c495f6\", \"u_business_service\": \"\", \"destination_ip\": \"ef51be4506d7d287abc8c26ea6c495f6\", u'valuee': u'9db92f08db4f951423c87d84f39619ef'
";
// 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/