// 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)^(Тема: )(.*)\n(Дата )(\d*.\d*.\d*)(.*)\n(Время )(.*)\n(Имя клиента )(.*)\n(Фамилия клиента )(.*)\n(Дата рождения )(.*)\n(Номер загран паспорта )(.*)\n(Дата окончания загран паспорта )(.*)\n(Гражданство )(.*)\n(Телефон )(.*)\n(E-mail )(.*)\n(Количество заявителей )(.*)\n(Инфо )(.*)\n(Ссылка)\n(.*)\n(.*)").unwrap();
let string = "Тема: Запись на прием
Дата 28.03.2020 17:30 - 28.03.2020 18:00
Время 17:30 - 18:00
Имя клиента Vovka
Фамилия клиента Simi
Дата рождения 283983
Номер загран паспорта 9839283
Дата окончания загран паспорта 28492849284
Гражданство Hjccbz
Телефон 9248924898
E-mail mail@mail.ru
Количество заявителей 1
Инфо 237582hg8yfrvgdr
Ссылка
https://france-visa-official.ru/wp-admin/admin.php?page=wpbc&view_mode=vm_listing&tab=actions&wh_booking_id=15
";
let substitution = "\\2,\\4,\\7,\\9,\\11,\\13,\\15,\\17,\\19,\\21,\\23,\\25,\\27,\\29";
// 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/