// 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)([\r\n].*?)(?:=?\r|\n)(.*?(?:14393).*)").unwrap();
let string = "<tr>
<td>CBB <span> • </span> CB <span> • </span> LTSB</td>
<td>2022-09-13</td>
<td>14393.5356</td>
<td><a href=\"https://support.microsoft.com/help/5017305\" target=\"_blank\" data-linktype=\"external\">KB5017305</a></td>
</tr>
<tr>
<td>CBB <span> • </span> CB <span> • </span> LTSB</td>
<td>2022-08-09</td>
<td>14393.5291</td>
<td><a href=\"https://support.microsoft.com/help/5016622\" target=\"_blank\" data-linktype=\"external\">KB5016622</a></td>
</tr>
<tr>
<td>CBB <span> • </span> CB <span> • </span> LTSB</td>
<td>2022-07-12</td>
<td>14393.5246</td>
<td><a href=\"https://support.microsoft.com/help/5015808\" target=\"_blank\" data-linktype=\"external\">KB5015808</a></td>
</tr>
<tr>
<td>CBB <span> • </span> CB <span> • </span> LTSB</td>
<td>2022-06-14</td>
<td>14393.5192</td>
<td><a href=\"https://support.microsoft.com/help/5014702\" target=\"_blank\" data-linktype=\"external\">KB5014702</a></td>
</tr>
<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/