// 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"<img[^>]+\>").unwrap();
let string = "<p><i>O Armário Amapá da Politorno, essencial e indispensável quando se trata de organização e bom gosto.</i></p>
<p>Disponível na cor:</p>
<p><img class=\"alignnone\" style=\"display: block; margin-bottom: 30px;\" src=\"https://www.solinemoveis.com.br/wp-content/uploads/2012/09/cores-de-madeira-branco.jpg\" alt=\"cores-de-madeira-branco\" width=\"153\" height=\"189\"></p>
<h4>Dimensões do Armário <strong> ARMP3-019 </strong>Amapá:</h4>
<p><img style=\"display: block; margin-bottom: 30px;\" src=\"https://www.solinemoveis.com.br/wp-content/uploads/2012/09/armario-organizador-amapa-branco-politorno-dimensoes1.jpg\" alt=\"armario-organizador-amapa-branco-politorno-dimensoes1\"></p>
<p>Visite também nossa página no facebook: https://www.facebook.com/solinemoveis/</p>
<p><a href=\"http://www.soline.com.br\"><br>
<img class=\"alignright size-medium\" src=\"https://www.solinemoveis.com.br/wp-content/uploads/2014/09/visite-loja-online-button-soline-moveis-soline.png\" alt=\"Armário Amapá\" width=\"179\" height=\"74\"><br>
</a></p>";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
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/