求助!~~~关于正则表达式

liemao 2006-04-30 06:07:33
<TABLE cellSpacing=1 cellPadding=3 width=98% align=center border=0>
<TBODY>
<TR align=middle>
<TD align=middle bgColor=#99ccff colSpan=2><B><SPAN id=dbNm>国产药品(含包材)</SPAN></B></TD></TR>
<TR id=row bgColor=#ffffff>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>批准文号</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><SPAN>国药准字Z41020402</SPAN></SPAN></TD></TR>
<TR id=row bgColor=#eaeaea>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>批准文号备注</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue> </SPAN></TD></TR>
<TR id=row bgColor=#eaeaea>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>产品名称</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><SPAN>杞菊地黄丸</SPAN></SPAN></TD></TR>
<TR id=row bgColor=#ffffff>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>英文名称</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue> </SPAN></TD></TR>
<TR id=row bgColor=#eaeaea>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>商品名</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue> </SPAN></TD></TR>
<TR id=row bgColor=#ffffff>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>生产单位</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><A style=COLOR: #0000ff href=/webportal/portal.po?UID=DWV1_WOUID_URL_11635827&POpType=DBSearch&DBSearch=DJSearch&DJSearch=DJDetailPg&DJDetailPg=NDU1Ng%3D%3D&selDbName=PLDB_TBL_TABLE4&tblCol=OID&Ptype1_sld=0&Ptype2_sld=0&Ptype3_sld=0>河南时珍制药有限公司</A></SPAN></TD></TR>
<TR id=row bgColor=#eaeaea>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>批准日期</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue> </SPAN></TD></TR>
<TR id=row bgColor=#ffffff>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>产品类别</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><SPAN>中药</SPAN></SPAN></TD></TR>
<TR id=row bgColor=#eaeaea>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>规格</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><SPAN>每丸重9g</SPAN></SPAN></TD></TR>
<TR id=row bgColor=#ffffff>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>剂型</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><SPAN>丸剂(大蜜丸)<BR></SPAN></SPAN></TD></TR>
<TR id=row bgColor=#eaeaea>
<TD vAlign=top width=120>
<DIV align=right><FONT color=#000066><SPAN id=colNm>原批准文号</SPAN></FONT></DIV></TD>
<TD><SPAN id=colValue><SPAN>ZZ-0193-豫卫药准字(1996)第047011号</SPAN></SPAN></TD></TR>
<TR id=mulLink bgColor=#eaeaea>
<TD>相关信息</TD>
<TD><A id=link style=COLOR: #0000ff href=/webportal/portal.po?UID=DWV1_WOUID_URL_11635827&POpType=DBSearch&DBSearch=DJSearch&DJSearch=DJLinkPg1&Ptype1_sld=0&Ptype2_sld=0&Ptype3_sld=0>中药品种保护</A><BR><A id=link style=COLOR: #0000ff href=/webportal/portal.po?UID=DWV1_WOUID_URL_11635827&POpType=DBSearch&DBSearch=DJSearch&DJSearch=DJLinkPg1&Ptype1_sld=0&Ptype2_sld=0&Ptype3_sld=0>药品广告</A><BR></TD></TR>
<TR id=desTr>
<TD align=right width=34>
<DIV align=right>注:</DIV></TD>
<TD><SPAN id=description style=FONT-SIZE: 14px; COLOR: #000066>显示数据若与批准证明文件有出入,请以该品种批准证明文件为准。如有异议,请将页面打印,并附情况说明及相关批准证明文件,传真至010-68362745,信息组收。</SPAN> </TD></TR></TBODY></TABLE>

上面是一个表格
我想提取右列<td>内的所有信息该怎么写啊
...全文
207 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
masterz 2006-05-15
  • 打赏
  • 举报
回复
I suggest to using some html parser
http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx
http://www.eggheadcafe.com/articles/20031027.ASP
webwalker 2006-05-13
  • 打赏
  • 举报
回复
string ResultString = null;
try {
ResultString = Regex.Match(SubjectString, "(?<=<td>)[\\s\\S]*(?=</td>)").Value;
} catch (ArgumentException ex) {
}
icansaymyabc 2006-05-05
  • 打赏
  • 举报
回复
\<TR.*?\>\s*\<TD.*?\>(?<tdleft>.*)\<\/TD\>\s*(?:(\<TD.*?\>(?<tdright>.*)\<\/TD\>))?\s*\<\/TR>

命名捕获:${tdleft} 得到左列;${tdright} 得到右列
liemao 2006-05-01
  • 打赏
  • 举报
回复
-_-

(?<=\bid=colValue>)(.*?)(?=\<)

我自己写了一个,能取得,但是遍历的时候都是空的



BlueDog 2006-04-30
  • 打赏
  • 举报
回复
太懒了吧,
liemao 2006-04-30
  • 打赏
  • 举报
回复
听说用DOM也可以做,但是我不知道用哪个控件,COM+的!~~~~
高手帮帮忙吧

17,748

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧