// 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"(?s)<a\s[^>]*?href\s*=\s*\\'https?://site\.ru/[^>]+>\s*<img.+?</a>").unwrap();
let string = "<a class=\\'fancybox\\' href=\\'http://site.ru/upload/manuals/3V/image_2022_01_28T12_03_17_757Z.jpg\\' rel=\\'group\\'><img src=\\'http://site.ru/upload/manuals/3V/image_2022_01_28T12_03_17_757Z.jpg\\' width=\\'400px\\'></img></a>
<a class=\\'fancybox\\' href=\\'http://site2.ru/upload/manuals/3V/image_2022_01_28T12_03_17_757Z.jpg\\' rel=\\'group\\'><img src=\\'http://site2.ru/upload/manuals/3V/image_2022_01_28T12_03_17_757Z.jpg\\' width=\\'400px\\'></img></a>
<a class=\\'fancybox\\' href=\\'http://site.ru/upload/manuals/3V/image_2022_01_28T12_03_17_757Z.jpg\\' rel=\\'group\\'><img src=\\'http://site.ru/upload/manuals/3V/image_2022_01_28T12_03_17_757Z.jpg\\' width=\\'400px\\'></img></a>";
let substitution = "";
// 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/