
October 2nd, 2012, 09:37 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 1
Time spent in forums: 10 m 32 sec
Reputation Power: 0
|
|
|
PHP - Match html li elements with nested br tag
How do I return the contents of all li elements when there are other tags (br, p, etc) within it before the closing tag is reached. For example ... with this data:
<li>Testhere and here</li>
<li>Test here2 and<br> there 2</li>
<li>Test here and there3</li>
I have tried this regular expression:
!<li>(?P<category1>[^(</li>)]*)</li>!
but it only returns the first and third list element ... how do I get all three?
Thanks in advance
|