Home  >  Article  >  Backend Development  >  哪位高手帮改个正则

哪位高手帮改个正则

WBOY
WBOYOriginal
2016-06-13 11:29:52852browse

谁帮改个正则?
这是要匹配的内容:

 

<br /><dl><br />	<dt>2013</dt><br />	<dd>row1</dd><br />	<dd>row2</dd><br />	<dd>row3</dd><br /></dl><br /><dl><br />	<dt>2014</dt><br />	<dd>row1</dd><br />	<dd>row2</dd><br /></dl><br />


要匹配dl,并且匹配dl下的dt,和所有的dd,

我是这样写的:

<dl>\s+<dt>(.*?)</dt>(\s+<dd>(.*?)</dd>\s+)*?</dl>


但是这个匹配出的结果不太对,dd始终只匹配到了最后一个。这个表达式应该怎么修改呢?

正则
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