// 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#"href=['"]?([^\s'"]+)['"]?(.*?)>(.*?)</a>"#).unwrap();
let string = "ahsgdjagshjdgasjdgajgsd gjagdjhagsjhgda sgdhjagsjdgajhgdjad<a href=\"http://short.awsubs.co/be9Vk\">Solidfiles</a> jashd sha7st7atsdgasgda sgahsfd ahgsfafd<a href=https://link.safelinkconverter.com/review.php?id=aHR0cDovL2JfdC5seS8ySDdMajh3&c=1&user=61942 rel=nofollow>Zippyshare</a>";
// 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/