// 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)^(\"(?:\"[^\"]*\",){3})\"[^\"]*\"|\"[^\"]*\"(\")$"#).unwrap();
let string = "\"\"00001\",\"Open\",\"2020-10-23 12:45\",\"2022-10-20 15:48\",\"Error not found\",\"Alex Smith\",\"NO ERROR\",\"ErrorApp\",\"FOB\",\"CNSHA\",\"GB\",\"Plane\",\"MODEL\",\"2020-10-24 00:00\",\"New\",\"1\",\"\",\"2022-10-20 15:48\"\"
";
let substitution = "$1\"\"$2";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
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/