title: Preg replace divs with li but keep class active
body: <p>Trying to get my head around how to create a PHP preg replace for a string that will convert</p>
  
  <pre><code>&lt;div class="active make_link"&gt;1&lt;/div&gt;
  &lt;div class="make_link digit"&gt;&lt;a href=""&gt;2&lt;/a&gt;&lt;/div&gt;
  &lt;div class="make_link digit"&gt;&lt;a href=""&gt;3&lt;/a&gt;&lt;/div&gt;
  etc
  </code></pre>
  
  <p>to </p>
  
  <pre><code>&lt;li class="active"&gt;1&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;3&lt;/a&gt;&lt;/li&gt;
  etc
  </code></pre>
  
  <p>Figured out how to replace the elements but not how to keep the class active.</p>
  
  <pre><code>$new_pagination = preg_replace('/&lt;div[^&gt;]*&gt;(.*)&lt;\/div&gt;/U', '&lt;li&gt;$1&lt;/li&gt;', $old_pagination);
  </code></pre>
  
  <p>Any ideas?</p>