Home > Backend Development > PHP Tutorial > 正则匹配-php正则表达式怎么匹配?

正则匹配-php正则表达式怎么匹配?

WBOY
Release: 2016-06-02 11:32:00
Original
829 people have browsed it

正则匹配php正则表达式

<code>    [0] => <trclass><tdwidth>1<tdwidth>2012-2013学年第一学期<br>            [1] => <trclass><tdwidth>2<tdwidth><br><tdwidth>[P209502]管理学基础<br>            [2] => <trclass><tdwidth>13<tdwidth>2012-2013学年第二学期<br>            [3] => <trclass><tdwidth>14<tdwidth><br><tdwidth>[P209500]经济学基础<br></tdwidth></tdwidth></tdwidth></trclass></tdwidth></tdwidth></trclass></tdwidth></tdwidth></tdwidth></trclass></tdwidth></tdwidth></trclass></code>
Copy after login

如上我用正则匹配出
preg_match_all('/(\d)*(\S)+?
/',
但是我只需要:

<code>  <trclass><tdwidth>1<tdwidth>2012-2013学年第一学期<br>     <trclass><tdwidth>13<tdwidth>2012-2013学年第二学期<br></tdwidth></tdwidth></trclass></tdwidth></tdwidth></trclass></code>
Copy after login

请问怎么写?

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template