// 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)class="snapshot__value-current realtime-push"><span>(\d*,\d*)<span> <span class="snapshot__value-unit">EUR"#).unwrap();
let string = "
</header><main class=\"page-content\"><nav class=\"breadcrumb margin-top-1.00 margin-top-0.50-lg margin-top-0.00-md margin-horizontal-2.00\"><ul class=\"breadcrumb__list\"><li class=\"breadcrumb__item\"><span class=\"breadcrumb__separator icon icon--arrow-double-right\"></span><a class=\"breadcrumb__text\" href=\"/\" title=\"Home\">Home</a></li><li class=\"breadcrumb__item\"><span class=\"breadcrumb__separator icon icon--arrow-double-right\"></span><a class=\"breadcrumb__text\" href=\"/aktienkurse\" title=\"Aktien\">Aktien</a></li><li class=\"breadcrumb__item\"><span class=\"breadcrumb__separator icon icon--arrow-double-right\"></span><span class=\"breadcrumb__text\" title=\"AURELIUS Aktie\">AURELIUS Aktie</span></li><script type=\"application/ld+json\">{\"@context\": \"http://schema.org\",\"@type\": \"BreadcrumbList\",\"itemListElement\": [{\"@type\": \"ListItem\",\"position\": 1,\"item\": {\"@type\": \"WebPage\",\"@id\": \"/\",\"name\": \"Home\"}},{\"@type\": \"ListItem\",\"position\": 2,\"item\": {\"@type\": \"WebPage\",\"@id\": \"/aktienkurse\",\"name\": \"Aktien\"}},{\"@type\": \"ListItem\",\"position\": 3,\"item\": {\"@type\": \"WebPage\",\"@id\": \"/aktien/aurelius-aktie\",\"name\": \"AURELIUS Aktie\"}}]}</script></ul></nav><section class=\"page-content__container\"><!--CenterColumn_1--><div class=\"page-content__item no-grid-container\"><div class=\"snapshot\"><script>document.addEventListener('DOMContentLoaded', function() {if(isFinnetZeroLoginCookieActive()){document.querySelectorAll('.page-content__container .snapshot').forEach(function(e) {e.classList.add('snapshot--is-zero-user');});}});</script><h1 class=\"snapshot__headline\">AURELIUS Aktie</h1><div class=\"snapshot__depot-actions\"><a class=\"snapshot__depot-add\" href=\"/depot/watchlist.asp?isisin=DE000A0JK2A8&inTyp=1\" title=\"Depot / Watchlist\"><span class=\"icon icon--depot-add\"></span></a></div><div id=\"snapshotTrading\" class=\"snapshot__trading\"><div class=\"snapshot__trading-buy-btn button button--success button--stretch-md\"><span class=\"button__label\">Kaufen</span></div><div class=\"snapshot__trading-sell-btn button button--danger button--stretch-md\"><span class=\"button__label\">Verkaufen</span></div></div><div class=\"snapshot__values\"><span id=\"snapshot-value-fst-current-0\" class=\"snapshot__value-current realtime-push\"><span>22,32</span> <span class=\"snapshot__value-unit\">EUR</span> </span><span id=\"snapshot-value-fst-absolute-0\" class=\"snapshot__value-absolut";
// 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/