Add the regex crate to your dependencies and use Regex::new to compile patterns, then call .replace_all or .is_match on your strings.
use regex::Regex;
let re = Regex::new(r"(?m)^ >").unwrap();
let fixed = re.replace_all(&input, ">");
For workspace projects like the Rust Book tools, define regex = "1.3.3" in [workspace.dependencies] and reference it with regex = { workspace = true } in your package's [dependencies].