// 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"(\/(static)\/)(.*)([0-9]{13}\/)").unwrap();
let string = " <link>http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/59fa119a24a694d3151e9f79/1509632943781/medellin-flower-festival-colombia-conde-nast-traveller-1april14-rex_-1.jpg</link>
<title>attachment-59fa119a24a694d3151e9f79</title>
<img src=\"http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/5a007536e4966b51e8d63db6/1509979480047/buenos-aires-unsettled-argentina-retreat-digital-nomad.jpgbuenos-aires-unsettled-argentina-retreat-digital-nomad?format=original\" alt=\"\"/>
<img src=\"http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/5a007536e4966b51e8d63db6/1509979480047/buenos-aires-unsettled-argentina-retreat-digital-nomad.jpgbuenos-aires-unsettled-argentina-retreat-digital-nomad?format=original\" alt=\"\"/>
\"http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/59fa1b0b71c10b694346e433/1509563194043/22860715_372374486541985_6060851298842968064_n.jpg\",";
// 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/