正則表達(dá)式的匹配td內(nèi)的數(shù)據(jù)

科技 未結(jié) 5 1026
vipmim
vipmim 2023-04-13 01:07

<tr> <td scope="col" align="center" valign="middle" nowrap>&nbsp;1</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;13110581130</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;徐小胖</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;男</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;2013</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;計(jì)算機(jī)科學(xué)與技術(shù)</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;</td> </tr><tr> <td scope="col" align="center" valign="middle" nowrap>&nbsp;2</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;13110581131</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;興小胖</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;男</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;2013</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;計(jì)算機(jī)科學(xué)與技術(shù)</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;</td> <td scope="col" align="center" valign="middle" nowrap>&nbsp;</td> <td scope="col" align="left" valign="middle" nowrap>&nbsp;</td> </tr>

我想匹配td內(nèi)的數(shù)據(jù),比如 徐小胖,

/<td scope="col" align=.*</td>/g

上面的正則還可以再優(yōu)化嗎?能更精確的抓取數(shù)據(jù)嗎?謝謝指點(diǎn)

5條回答
提交回復(fù)