// 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)<tag-1>.*?</tag-1>").unwrap();
let string = "<p>You will find below reports for customer <b>[CustomerName]</b> dated <b>[ReportdDate]</b></p>
<tag-1>
<h3>Title1</h3>
<table>
<thead id=\"t01\">
<tr>
<th align='center' width='80'>Order Nr</th>
<th align='left' width='400'>Planning date</th>
<th align='left' width='200'>Info</th>
<th align='center' width='200'>Site Name</th>
</tr>
</thead>
<tbody>
[TableTodo]
</tbody>
</table>
</tag-1>
<tag-2>
<h3>Title2</h3>
<table>
<thead id=\"t01\">
<tr>
<th align='center' width='80'>Order Nr</th>
<th align='left' width='100'>Date</th>
<th align='left' width='400'>Info</th>
<th align='center' width='200'>Site Name</th>
</tr>
</thead>
<tbody>
[TableTodo]
</tbody>
</table>
</tag-2>";
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/