// 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"([\*]*Highlight \[page [^\]]*\]: ?[\*]* ?)").unwrap();
let string = "**Highlight [page 1]:** Effectiveness of Measures to Eradicate Staphylococcus aureus Carriage in Patients with Community-Associated Skin and Soft Tissue Infections:
**Highlight [page 1]:** Background—Despite a paucity of evidence, decolonization measures are prescribed for outpatients with recurrent Staphylococcus aureus skin and soft tissue infections (SSTI).
**Highlight [page 1]:** Participants were randomized to receive no therapeutic intervention (controls) or perform one of three 5-day regimens: 2% mupirocin ointment applied to the nares twice daily, intranasal mupirocin plus daily 4% chlorhexidine body washes, or intranasal mupirocin plus daily dilute bleach water baths.";
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/