// 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#"(?U)((?<=\s)data-[^="]+?=".+(?=["]\s)")|((?<=\s)(?:data-[^=]+?)=".+?(?=>))|((?<=\s)(?:data-[^=]+?)="[^>]+?(?=>))"#).unwrap();
let string = "<p><style type=\"text/css\"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style><span style=\"font-size:10pt;font-family:Calibri, Arial;\" data-sheets-value=\"{\"1\":2,\"2\":\"When doing a Future trade workflow, and selecting this Future asset to be traded on, a vos displayed showing that the Futures Type (which is the asset subtype) does not have Geneva ID on it. After some investigation, turns out that the actual Futures subtype list does not contain the list item \\\"Physical index future.\\\", which is currently showing for Asset ID 3175, as seen in attached Picture 2. \"}\" data-sheets-userformat=\"{\"2\":13249,\"3\":{\"1\":0},\"9\":0,\"10\":0,\"11\":4,\"12\":0,\"15\":\"Calibri\",\"16\":10}\">When doing a Future trade workflow, and selecting this Future asset to be traded on, a vos displayed showing that the Futures Type (which is the asset subtype) does not have Geneva ID on it. After some investigation, turns out that the actual Futures subtype list does not contain the list item \"Physical index future.\", which is currently showing for Asset ID 3175, as seen in attached Picture 2</span></p>";
// 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/