use regex::Regex; fn main() { let pattern = r"(unclosed parenthesis"; match Regex::new(pattern) { Ok(re) => println!("Regex compiled successfully."), Err(err) => println!("Failed to compile regex: {}", err), } }