title: use preg match and replace to replace li tags within ol tags
body: <p>Here is what i got:</p>
  
  <pre><code>&lt;ol&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;/ol&gt;
  
  &lt;ul&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  
  if (preg_match("/&lt;ol&gt;.*(&lt;li(|\s*\/)&gt;).*&lt;\/ol&gt;/Ums", $text-&gt;Bodytext)) {
  $cleanlist = preg_replace("/(&lt;li(|\s*\/)&gt;)/", "&lt;li&gt;&lt;tag&gt;", $text-&gt;Bodytext);
  </code></pre>
  
  <p>This php code works well if the page only contains ol tags, but if it contains both ul and ol tags for some reason it changes li tags inside ul tags too and I only want it to replace it within ol tags. What could be the problem and how can i fix it?</p>