C# 正则表达式取值

<table cellSpacing="0" cellPadding="2" width="682" border="0" style="WIDTH: 682px; HEIGHT: 324px">
   
<tr height="10">
       
<td colSpan="2"><FONT face="宋体"></FONT></td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px" width="88"><span class="style3">单位名称:</span></td>
       
<td style="HEIGHT: 20px" width="586">北京汇京鸿运汽车贸易发展有限公司</td>
   
</tr>
   
<TR>
       
<TD style="HEIGHT: 20px" width="88"><FONT face="宋体">服务类型:</FONT></TD>
       
<TD style="HEIGHT: 20px" width="586"><FONT face="宋体">经销商</FONT></TD>
   
</TR>
   
<TR>
       
<TD style="HEIGHT: 20px" width="88"><FONT face="宋体">&nbsp;&nbsp;别:</FONT></TD>
       
<TD style="HEIGHT: 20px" width="586"><FONT face="宋体">专营店</FONT></TD>
   
</TR>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">所在地区:</span></td>
       
<td style="HEIGHT: 20px">北京市  北京</td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">单位地址:</span></td>
       
<td style="HEIGHT: 20px">北京市丰台区丰益桥丰管路46号</td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">邮政编码:</span></td>
       
<td style="HEIGHT: 20px">100071</td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">服务电话:</span></td>
       
<td style="HEIGHT: 20px">010-63842828(服务),010-63846888(服务),63855857-251(销售)</td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">联系人:</span></td>
       
<td style="HEIGHT: 20px">郑东男</td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">电子邮件:</span></td>
       
<td style="HEIGHT: 20px">beijinghuijinghongyun@fengshenmotor.com</td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px"><span class="style3">网站地址:</span></td>
       
<td style="HEIGHT: 20px"></td>
   
</tr>
   
<tr height="30">
       
<td style="HEIGHT: 20px" vAlign="middle"><span class="style3">单位介绍:</span></td>
       
<td style="HEIGHT: 20px"></td>
   
</tr>
</table>

表达式为
Regex re = new Regex("(?<=<td[^>]*>).*?(?=</td>)");
Match m
= re.Match(input);
while(m.Success)
{
    Console.WriteLine(m.Value);
    Console.WriteLine(
"----Next Match----");
    m
= m.NextMatch();
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值