// 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#"(?m)<td.*?class="namelinks".*?">(.+?)</a>"#).unwrap();
let string = "<tr>
<td class=\"field_domain\"><a href=\"/goto/1/eboo74/2/\" target=\"_blank\" title=\"advocaciamdc.com\" class=\"namelinks\" id=\"linksdd-domaineboo74\">advocaciamdc.com</a><ul id=\"links-domaineboo74\" class=\"kmenucontent\" style=\"display:none;\"><li class=\"first\"><a href=\"/goto/16/eg4d59/2/\" target=\"_blank\" class=\"favicons favgodaddy\" title=\"Register at GoDaddy.com\">GoDaddy.com</a></li><li><a href=\"/goto/53/ee87fh/2/\" target=\"_blank\" class=\"favicons favdynadot\" title=\"Register at Dynadot.com\">Dynadot.com</a></li><li><a href=\"/goto/43/eecp19/2/\" target=\"_blank\" class=\"favicons favnamecheap\" title=\"Register at Namecheap.com\">Namecheap.com</a></li></ul></td>
<td class=\"field_watchlist\"><span class=\"wl\" id=\"wl-2-eboo74\"></span></td>
<td class=\"field_length\">12</td>
<td class=\"field_bl\"><a href=\"/goto/34/ebdukr/2/\" target=\"_blank\" class=\"bllinks\" title=\"0\" id=\"backlinks-bleboo74\">0</a><ul id=\"links-bleboo74\" class=\"kmenucontent\" style=\"display:none;\"><li class=\"first\"><a href=\"/goto/34/ebdukr/2/\" target=\"_blank\" class=\"favicons favmajestic\" title=\"Check Backlinks on Majestic.com\">Majestic.com</a></li><li class=\"seperator\"> </li><li><a href=\"/goto/28/eg64b8/2/\" target=\"_blank\" class=\"favicons favseokicks\" title=\"Check Backlinks on SEOkicks.de\">SEOkicks.de</a></li><li><a href=\"/goto/56/ed1td8/2/\" target=\"_blank\" class=\"favicons favsemrush\" title=\"Check Backlinks on SEMRush.com\">SEMRush.com</a></li><li><a href=\"/goto/27/ecwtfo/2/\" target=\"_blank\" class=\"favicons favsearchm\" title=\"Searchmetrics\">Searchmetrics</a></li></ul></td>
<td class=\"field_domainpop\"><a href=\"/goto/28/eg64b8/2/\" target=\"_blank\" title=\"0\">0</a></td>
<td class=\"field_creationdate\"><a href=\"/goto/8/edemrz/2/\" target=\"_blank\" title=\"Whois Creation Date: 2019-08-06\">2019</a></td>
<td class=\"field_abirth\">-</td>
<td class=\"field_aentries\"><a href=\"/goto/6/eddzzf/2/\" target=\"_blank\" title=\"0 saved crawl results\">0</a></td>
<td class=\"field_alexa\"><a href=\"/goto/4/eddwsg/2/\" target=\"_blank\" title=\"0\" class=\"\">0</a></td>
<td class=\"field_majestic_globalrank\"><a href=\"/goto/34/ebdukr/2/\" target=\"_blank\">0</a></td>
<td class=\"field_dmoz\">-</td>
<td class=\"field_statustld_registered\"><a href=\"/domain/advocaciamdc.com#namestatus\" target=\"_blank\">0</a></td>
<td class=\"field_statuscom\"><a href=\"/goto/18/efli0j/2/?tld=com\" target=\"_blank\" class=\"sprite stlds stld22c\" title=\".com available\"><span>available</span></a></td>
<td class=\"field_statusnet\"><a href=\"/goto/18/efli0j/2/?tld=net\" target=\"_blank\" class=\"sprite stlds stld22c\" title=\".net available\"><span>available</span></a></td>
<td class=\"field_statusorg\"><a href=\"/goto/18/efli0j/2/?tld=org\" target=\"_blank\" class=\"sprite stlds stld22c\" title=\".org available\"><span>available</span></a></td>
<td class=\"field_statusbiz\"><a href=\"/goto/18/efli0j/2/?tld=biz\" target=\"_blank\" class=\"sprite stlds stld22c\" title=\".biz available\"><span>available</span></a></td>
<td class=\"field_statusinfo\"><a href=\"/goto/18/efli0j/2/?tld=info\" target=\"_blank\" class=\"sprite stlds stld22c\" title=\".info available\"><span>available</span></a></td>
<td class=\"field_statusde\"><a href=\"/goto/18/efli0j/2/?tld=de\" target=\"_blank\" class=\"sprite stlds stld22c\" title=\".de available\"><span>available</span></a></td>
<td class=\"field_adddate\">2020-10-25</td>
<td class=\"field_related_cnobi\">-</td>
<td class=\"field_wikipedia_links\">-</td>
<td class=\"field_changes\">Yesterday 18:55</td>
<td class=\"field_whois\"><a href=\"/goto/1/eboo74/2/\" target=\"_blank\" title=\"Register now\" class=\"status_free\">available</a></td>
<td class=\"field_relatedlinks\"><a class=\"sprite sicon smenu domainlinks\" href=\"#\" id=\"expiredcom-eboo74\" title=\"Related Links (click here for menu)\"><span>RL</span></a><ul id=\"links-eboo74\" class=\"kmenucontent\" style=\"display:none;\"><li class=\"first\"><a href=\"/goto/16/eg4d59/2/\" target=\"_blank\" class=\"favicons favgodaddy\" title=\"Register at GoDaddy.com\">GoDaddy.com</a></li><li><a href=\"/goto/53/ee87fh/2/\" target=\"_blank\" class=\"favicons favdynadot\" title=\"Register at Dynadot.com\">Dynadot.com</a></li><li><a href=\"/goto/43/eecp19/2/\" target=\"_blank\" class=\"favicons favnamecheap\" title=\"Register at Namecheap.com\">Namecheap.com</a></li><li class=\"seperator\"> </li><li><a href=\"/domain/advocaciamdc.com\" class=\"favicons favhomepage\" target=\"_blank\" title=\"Domain Details on ExpiredDomains.net\">Domain Details</a></li><li><a href=\"/goto/116/ebesj8/2/\" target=\"_blank\" class=\"favicons favgodaddy\" title=\"GoDaddy.com Appraisal\">GoDaddy Appraisal</a></li><li><a href=\"/goto/25/eep3go/2/\" target=\"_blank\" class=\"favicons favsemrush\" title=\"Check Rankings on SEMRush.com\">SEMRush</a></li><li><a href=\"/goto/93/eb1rfr/2/\" target=\"_blank\" class=\"favicons favtrademarkia\" title=\"Check Domain Name on Trademarkia\">Trademarkia</a></li><li><a href=\"/goto/7/ec5uh7/2/\" target=\"_blank\" class=\"favicons favgoogle\" title=\"Google the Domain Name\">Google Name</a></li><li><a href=\"/goto/11/eekeoy/2/\" target=\"_blank\" class=\"favicons favgoogle\" title=\"Google info:domain.tld\">Google Info</a></li><li><a href=\"/goto/15/ef6qyy/2/\" target=\"_blank\" class=\"favicons favgoogle\" title=\"Google site:domain.tld\">Google Site</a></li><li><a href=\"/goto/6/eddzzf/2/\" target=\"_blank\" class=\"favicons favarchiveorg\" title=\"Check Website in Wayback Machine\">Wayback Machine</a></li><li><a href=\"/goto/9/ebbfv1/2/\" target=\"_blank\" class=\"favicons favhomepage\" title=\"Visit the Website\">Visit Domain</a></li><li><a href=\"/goto/8/edemrz/2/\" target=\"_blank\" class=\"favicons favwhois\" title=\"Whois Domain\">Whois Domain</a></li><li><a href=\"/goto/21/ecqo3m/2/\" target=\"_blank\" class=\"favicons favdomaintools\" title=\"Check Domainhistory on Domaintools.com\">Domaintools.com</a></li></ul></td>
</tr>";
// 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/