// 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)<div>.*?<\/div>").unwrap();
let string = "<div class=\"scrollable \" style=\"height: 200px;\">
<div>
<p>CO-Schrank: nicht benötigtes ausbauen</p>
<p><strong>________________________________________________________________________</strong></p>
<p><strong>==> wird nicht mehr benötigt!<br /></strong>z-B.: IUC</p>
<p>CO-Management in Gen. 2 implementieren</p>
<ol>
<li>Ausbau der PCI-Karten aus ZKA-PC in CO-PC- PC-Sys 02 TP 55, 56, 61 sind noch Profibus im ZKA-PC ==> in CO-PC- PC-Sys 02 greift dann auf CO-PC für Datenaufzeichnung => Betrieb wieder aufnehmen</li>
<li>Ausbau der IUC</li>
<li>Testaufbau am CO-PC für den CO-Algorithmus und Datenspeicherung</li>
<li>Gen. 2 in CO-Management implementieren- pro Prüfling 3 Min. (3 Min. x 48 HG x 10 Messungen) = 1440 Min. = 24 h- Messzeit 1-2 Min.</li>
</ol>
</div></div>";
// result will be a tuple containing the start and end indices for the first match in the string
let result = regex.captures(string);
let (start, end) = match result {
Some((s, e)) => (s, e),
None => {
// ...
}
};
println!("{}", &string[start, end]);
}
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/