string s = @" <th>key1111 </th><td>values1111 </td> "; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<th>(.*?)</th>(?:.|\n)*?<td>(.*?)</td>"); System.Text.RegularExpressions.MatchCollection matches = regex.Matches(s); Console.WriteLine(matches[0].Groups[2]);
string s = @" <th>key1111 </th><td>values1111 </td> "; Match result = Regex.Match(s, "<th[^>]*>(?<title>[^<]*)</th>[^<]*<td[^>]*>(?<value>[^<]*)</td>"); Response.Write(result.Groups["title"]); Response.Write(result.Groups["value"]);
string s = @"
<th>key1111 </th><td>values1111 </td>
";
System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<th>(.*?)</th>(?:.|\n)*?<td>(.*?)</td>");
System.Text.RegularExpressions.MatchCollection matches = regex.Matches(s);
Console.WriteLine(matches[0].Groups[2]);
string s = @"
<th>key1111 </th><td>values1111 </td>
";
Match result = Regex.Match(s, "<th[^>]*>(?<title>[^<]*)</th>[^<]*<td[^>]*>(?<value>[^<]*)</td>");
Response.Write(result.Groups["title"]);
Response.Write(result.Groups["value"]);