// 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#"(?si)(.*)<p><a .+href=".+">.+<\/a><\/p>\s(.*)$"#).unwrap();
let string = "<h3>СВЕРХПЛОТНОЕ ЗАЩИТНОЕ ПОКРЫТИЕ</h3>
<p>Тут текст описание и бла-бла-бла</p>
<p>Состав бла-бла-бла</p>
<p><a class=\"download pdf\" href=\"assets/files/techdoc1.pdf\" target=\"_blank\"><span>Тех. описание Товара</span></a></p>
<h3>Область применения</h3>
<p>Область применения и бла-бла-бла</p>";
let substitution = "$1<!------- Вырезанная ссылка --------->\\n$2";
// result will be a String with the substituted value
let result = regex.replace(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/