// 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)(\d+)\.\s"([a-zA-Z ]+)"\s[a-zA-Z \.]+\s([a-zA-Z, \.]+)\s([\d:]+)"#).unwrap();
let string = "1. \"Anbae Anbae\" Vairamuthu Hariharan, K. S. Chitra 5:10
2. \"I Love You\" Vairamuthu Nandini Srikar, KK, Ajith Kumar 4:55
3. \"Nathi Enge Valaiyum\" Vairamuthu Ghanshyam Vaswani 4:37
4. \"Nothing Nothing\" Vairamuthu Harini 4:44
5. \"Poovukellam Siragu\" Vairamuthu Srinivas, KK, Harini 5:27
6. \"Vannakili SolKonda\" Vairamuthu Gopal Rao, Harini, Chorus 4:38";
let substitution = "\\1 \\2 - \\3 \\4";
// 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/