Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I have the following string:
$str = "
<li>r</li>
<li>a</li>
<li>n</li>
<li>d</li>
...
<li>om</li>
";
How do I get the HTML for the first n-th <li>
tags?
Ex : n = 3 ; result = "<li>r<...>n</li>;
I would like a regexp if possible.