111,126
社区成员
发帖
与我相关
我的任务
分享| 第一行 | |
| 第二行 |
using System;
using System.Text.RegularExpressions;
namespace CSDN
{
class Application
{
static void Main(string[] args)
{
string sSource = "<table> <tr> <td>第一行 </td> </tr> <tr> <td>第二行 <td> </tr> </table>";
MatchCollection mc = Regex.Matches(sSource,"<tr>(.*?)</tr>",RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
Console.WriteLine(m.Value.Trim());
Console.WriteLine(m.Groups[1].Value.Trim());
Console.WriteLine("\n\n");
}
Console.ReadLine();
}
}
}