// 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)^(.*)\.\(.*\)").unwrap();
let string = "DGL1PLAN_PUT_PFC.FCA#FKS.(CAD17_2013-01-30-21.35.29)
DSN8CC91.DSN8CLTC.(2015-01-14-16.33.06.616783)
DSNAOCLI.DSNCLICS.(UQ40167)
DSNJAR.DSNX9DIJ.(UK81051)";
let substitution = "$1";
// 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/