// 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#"(?mU)<select(?:(?!<\/select)[\n\s\S])*data-level="2"[\n\s\S]*?<\/select>"#).unwrap();
let string = "<div class=\"lsd-search-filter lsd-col-10\">
<label for=\"lsd_search_10574_listdom-location\">Regions</label>
<div class=\"lsd-hierarchical-dropdowns\" id=\"lsd_search_10574_listdom-location_wrapper\" data-for=\"listdom-location\" data-id=\"lsd_search_10574_listdom-location\" data-max-levels=\"2\" data-name=\"sf-listdom-location\" data-hide-empty=\"0\">
<select class=\"listdom-location\" name=\"sf-listdom-location\" id=\"lsd_search_10574_listdom-location_1\" placeholder=\"Select Region\" data-level=\"1\">
<option value=\"\">Select Region</option>
<option class=\"lsd-option lsd-parent-0\" value=\"289\">Region 1</option>
<option class=\"lsd-option lsd-parent-0\" value=\"391\">Region 2</option>
<option class=\"lsd-option lsd-parent-0\" value=\"290\">Region 3</option>
</select>
<select class=\"listdom-location\" name=\"\" id=\"lsd_search_10574_listdom-location_2\" placeholder=\"Select Region\" data-level=\"2\">
<option value=\"\">Select Region</option>
<option class=\"lsd-option lsd-parent-289\" value=\"291\">Area 1</option>
<option class=\"lsd-option lsd-parent-289\" value=\"292\">Area 2</option>
</select>
</div>
</div>";
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/