// 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"<h(?:[\d]{1})(?:.*?)>(.*?)<\/h(?:[\d]{1})>").unwrap();
let string = "<h1 class=\"text-align-center\" style=\"font-size:22px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-family:IntroBold, sans-serif;line-height:1.5;letter-spacing:0px;font-weight:700;text-align:center;\">You should be confident solving wicked problems in a hybrid role between strategy, research, design and business through a discovery driven approach. </h1><p></p><h2 style=\"margin-top:0px;margin-bottom:.5em;font-family:IntroBold, sans-serif;font-size:19px;line-height:1em;text-transform:uppercase;letter-spacing:1px;font-weight:700;\"><strong>KEY RESPONSIBILITIES</strong></h2>";
let substitution = "<strong>$1</strong>";
// 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/