// 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=\"kick_t_dt\".+?(.+?)<\/span> <span class=\"kick_t_ko\".+?(.+?)<\/span>.+?(.+?)href=\'.+?(.+?)\/\'.+?(.+?)<\/a><\/td><td.+?(.+?)\/\'.+?(.+?)<\/a>"#).unwrap();
let string = "</table>
<div class=\"ncet\"><li class=\"gradient6 ncet_round c25px\">Eastern - Round 1</li></div><div class=\"compgrp\"><div id=\"sc2209577-1\" class=\"scorecard\" title=\"\"></div><table class=\"blocks gteam team53089-1 team40896-1\" onmouseover=\"rowOver('53089-1','40896-1')\" onmouseout=\"resetOver()\">
<tbody><tr class=\"even\"><td class=\"kick_t\"><span class=\"kick_t_dt\">11.05.19</span> <span class=\"kick_t_ko\">20:00</span></td><td class=\"status\"></td><td class=\"home uc \"> <a href='/soccer/usa/teams/fc-cincinnati-NTMwODk=/'>FC Cincinnati</a></td><td class=\"score\"> - </td><td class=\"away uc \"><a href='/soccer/canada/teams/montreal-impact-NDA4OTY=/'>Montreal Impact</a> </td>
<td class=\"halftime\">-</td>
<td class=\"fav\"></td><td class='fav'></td><td class=\"fav\"><span id=\"m2209577-1\" class=\"spriteCCCCCC c42px ui-icon-plus-game matchbox\" title=\"\"></span></td></tr></tbody></table></div><div class=\"splitter\"></div><div class=\"ncet\"><li class=\"gradient6 ncet_round c25px\">Western - Round 1</li></div><div class=\"compgrp\"><div id=\"sc2209578-1\" class=\"scorecard\" title=\"\"></div><table class=\"blocks gteam team10751-1 team9956-1\" onmouseover=\"rowOver('10751-1','9956-1')\" onmouseout=\"resetOver()\">
<tbody><tr class=\"odd\"><td class=\"kick_t\"><span class=\"kick_t_dt\">11.05.19</span> <span class=\"kick_t_ko\">21:00</span></td><td class=\"status\"></td><td class=\"home uc \"> <a href='/soccer/usa/teams/fc-dallas-MTA3NTE=/'>FC Dallas</a></td><td class=\"score\"> - </td><td class=\"away uc \"><a href='/soccer/usa/teams/new-york-red-bulls-OTk1Ng==/'>New York Red Bulls</a> </td>
<td class=\"halftime\">-</td>
<td class=\"fav\"></td><td class='fav'></td><td class=\"fav\"><span id=\"m2209578-1\" class=\"spriteCCCCCC c42px ui-icon-plus-game matchbox\" title=\"\"></span></td></tr></tbody></table></div><div class=\"splitter\"></div><div class=\"ncet\"><li class=\"gradient6 ncet_round c25px\">Eastern - Round 1</li></div><div class=\"compgrp\"><div id=\"sc2209579-1\" class=\"scorecard\" title=\"\"></div><table class=\"blocks gteam team29401-1 team36415-1\" onmouseover=\"rowOver('29401-1','36415-1')\" onmouseout=\"resetOver()\">
<tbody><tr class=\"even\"><td class=\"kick_t\"><span class=\"kick_t_dt\">11.05.19</span> <span class=\"kick_t_ko\">22:00</span></td><td class=\"status\"></td><td class=\"home uc \"> <a href='/soccer/usa/teams/toronto-fc-Mjk0MDE=/'>Toronto FC</a></td><td class=\"score\"> - </td><td class=\"away uc \"><a href='/soccer/usa/teams/philadelphia-union-MzY0MTU=/'>Philadelphia Union</a> </td>
<td class=\"halftime\">-</td>
<td class=\"fav\"></td><td class='fav'></td><td class=\"fav\"><span id=\"m2209579-1\" class=\"spriteCCCCCC c42px ui-icon-plus-game matchbox\" title=\"\"></span></td></tr></tbody></table></div><div class=\"splitter\"></div><div class=\"ncet\"><li class=\"gradient6 ncet_round c25px\">Western - Round 1</li></div><div class=\"compgrp\"><div id=\"sc2209580-1\" class=\"scorecard\" title=\"\"></div><table class=\"blocks gteam team9955-1 team49517-1\" onmouseover=\"rowOver('9955-1','49517-1')\" onmouseout=\"resetOver()\">
<tbody><tr class=\"odd\"><td class=\"kick_t\"><span class=\"kick_t_dt\">11.05.19</span> <span class=\"kick_t_ko\">23:00</span></td><td class=\"status\"></td><td class=\"home uc \"> <a href='/soccer/usa/teams/los-angeles-galaxy-OTk1NQ==/'>Los Angeles Galaxy</a></td><td class=\"score\"> - </td><td class=\"away uc \"><a href='/soccer/usa/teams/new-york-city-fc-NDk1MTc=/'>New York City FC</a> </td>";
// 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/