title: Replace div with regex
body: <p>i need to replace all div's containig class "ta" and id "ta_somenumber" with textareas that will keep same attributes. Here is example code:</p>
  
  <pre><code>$html_content = '&lt;div class="ta" id="ta_345"&gt;sometext&lt;/div&gt;&lt;span style="..."&gt;Some text&lt;/span&gt;&lt;--!more html--&gt;&lt;div class="ta" id="ta_5687"&gt;sometext&lt;/div&gt;';
  </code></pre>
  
  <p>Here is what i want to achieve:</p>
  
  <pre><code>$html_new_content = '&lt;textarea class="ta" id="ta_345"&gt;sometext&lt;/textarea&gt;&lt;span style="..."&gt;Some text&lt;/span&gt;&lt;--!more html--&gt;&lt;textarea class="ta" id="ta_5687"&gt;sometext&lt;/textarea&gt;';
  </code></pre>
  
  <p>I was trying with this:</p>
  
  <pre><code>$regex1 = '#\&lt;div class=\"ta\" id=\"(.*)\"\&gt;(.+?)\&lt;\/div\&gt;#s';
  $regex2 = '#\&lt;textarea class=\"ta\" id=\"(.*)\"\&gt;(.+?)\&lt;\/textarea\&gt;#s';
  
  $result = str_replace($regex2, $regex3, $html_content);
  </code></pre>
  
  <p>But for some reason this doesnt work. I tried with preg_replace but no luck.</p>