// 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(Имя - )(.*)\n(Фамилия - )(.*)\n(E-mail - )(.*)\n(Мобильный телефон - )(.*)\n(Улица - )(.*)\n(Дом - )(.*)\n(Корпус - )(.*)\n(Строение - )(.*)\n(Квартира - )(.*)\n(Время забора документов - )(.*)\n(Комментарий - )(.*)").unwrap();
let string = "Заявка на забор документов
Имя - Владимир
Фамилия - Симигин
E-mail - v.simigin@gmail.com
Мобильный телефон - +79141861116
Улица - Большая Черемушкинская
Дом - 20
Корпус - 1
Строение -
Квартира - 34
Время забора документов - 13:00 - 16:00
Комментарий - Код домофона 39ключ7289";
let substitution = "\\1,\\3,\\5,\\7,\\9,\\11,\\13,\\15,\\17,\\19,\\21,\\23";
// 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/