Home  >  Article  >  Backend Development  >  请问高人,我要取到<tr>.</tr>里面的数据的正则怎么写?

请问高人,我要取到<tr>.</tr>里面的数据的正则怎么写?

WBOY
WBOYOriginal
2016-06-23 14:10:43845browse

例子:

<tr id="row_id_3" class=" zebra "><td class="fade-number font90"> 3. </td><td class="td-graph " title="Ahrefs Rank" "=""><div class="relative"><table style="width: 42.31%; height: 69px;"></td><td class="text-right " title="Ahrefs Domain Rank" "=""><td class="line12 "><td class="text-center line15 font90 "><td class="text-lefr font90 blink-holder "><td class="line12 p1 " colspan="2"><table class="width-100 fixed-table font90"></td></tr>
等高人!谢谢


回复讨论(解决方案)

补充一下:
我要取到table中的一系列

,然后分别处理每个tr。//i 为什么不对呢?
在线等大侠

指定tr还是所有tr , 如果所有tr , 可用 /

]*>(.+)/isU 

谢谢jordan102大神的回复,是要匹配每个tr,我要采集的的信息在table里面的信息,还有其他的tr,用preg_match_all来取出每个tr,分别来处理。所以了,需要匹配每个tr。

那就对了,上面那个正则可行。

我现在就卡在 “

哦 谢谢jordan102,不是意思,我忘了说了,页面里面还有其他的table,这样的话,其他table里面的tr也抓过来了!

/

/i

/

/i
==========================================
这个匹配不上!不知道为什么 就在这个空白的位置!

其他table与你要取的table的tr有什么区别,你并没有说明,谁知道你的意思呢?

啊!不好意思,这个页面有好几个table,我只想要其中一个table中的tr,并且只有这个tabale里面的tr有id号,所以就想根据id来抓tr。实在不行,我就用力上面提供的方法吧,在数组里面处理看行不行。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn