using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".*?(<td style=""width:50%"">((?!<\/td>).)*?<\/td>)";
string substitution = @"";
string input = @"<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>";
RegexOptions options = RegexOptions.Singleline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx