// 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)\|*Admin\|*").unwrap();
let string = "1H|\\^&|||ARCHITECT^8.10^F3453010030^H1P1O1R1C1Q1L1|||Admin||||P|1|20150511083525
1D";
let substitution = "|";
// 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/