// 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#"(?s).*?(<td style="width:50%">((?!<\/td>).)*?<\/td>)"#).unwrap();
let string = "<div class=\"criteria\" style=\"padding-left:0;font-style:italic\"> You searched for:
<span title=\"A*\" >Individual: <span><b>A*</b></span></span>
</div>
</td>
</tr>
</table> <table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"border-collapse: collapse; width: 100%\">
<tr class=\"ListItemColorNew\">
<td style=\"width:50%\">
<div class=\"gvListItemStyle\">
<span class=\"LargeText15\">JAMES BOND A'MONEYPENNY </span> (LIC# 1111111)
<div class=\"GrayTextShade\"><i>Alternate Names: BOND JAMES</i></div>
<div class=\"GrayTextShade\">
GREY TIDE LLC (LIC# 2222)
</div>
</div>
</td>
<td style=\"width: 25%; vertical-align: top\">
<div class=\"gvListItemStyle\">
<div><img alt=\"help\" src=\\'/Content/images/BrokerCheck/icon-blueCheck.png\\' style=\\'vertical-align:top;padding-right:5px\\' />Broker</div>
</div>
</td>
<td style=\"width:25%;text-align:right;vertical-align:top\">
<div class=\"gvListItemStyle\">
<a class=\"btn btn-primary\" href=\"/Individual/Summary/5820616\">Details »</a> </div>
</td>
</tr>";
let substitution = "";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
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/