// 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)https\:\/\/www\.bugaboo\.com\/(nl|de|us|gb|es)-.{2}\/(campingbedje|reisebett|travel\-cot|play\-yard|cuna\-de\-viaje)\/").unwrap();
let string = "NL
https://www.bugaboo.com/nl-nl/campingbedje/
https://www.bugaboo.com/nl-en/travel-cot/
DE
https://www.bugaboo.com/de-de/reisebett/
https://www.bugaboo.com/de-en/travel-cot/
US
https://www.bugaboo.com/us-en/play-yard/
https://www.bugaboo.com/us-es/play-yard/
GB
https://www.bugaboo.com/gb-en/travel-cot/
ES
https://www.bugaboo.com/es-es/cuna-de-viaje/
https://www.bugaboo.com/es-en/travel-cot/
";
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/