title: Use regular expressions to remove HTML tags in Flex/AS3
body: <p>I'm writing a HTML parser in Flex (AS3) and I need to remove some HTML tags that are not needed.</p>
  
  <p>For example, I want to remove the divs from this code:</p>
  
  <pre><code>           &lt;div&gt;
                &lt;div&gt;
                  &lt;div&gt;
                    &lt;div&gt;
                      &lt;div&gt;
                        &lt;div&gt;
                          &lt;div&gt;
                            &lt;p style="padding-left: 18px; padding-right: 20px; text-align: center;"&gt;
                              &lt;span&gt;&lt;/span&gt;
                              &lt;span style=" font-size: 48px; color: #666666; font-style: normal; font-weight: bold; text-decoration: none; font-family: Arial;"&gt;20% OFF.&lt;/span&gt;
                              &lt;span&gt; &lt;/span&gt;
                              &lt;span style=" font-size: 48px; color: #666666; font-style: normal; font-weight: normal; text-decoration: none; font-family: Arial;"&gt;Do it NOW!&lt;/span&gt;
                              &lt;span&gt; &lt;/span&gt;
                            &lt;/p&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>and end with something like this:</p>
  
  <pre><code>                      &lt;div&gt;
                            &lt;p style="padding-left: 18px; padding-right: 20px; text-align: center;"&gt;
                              &lt;span&gt;&lt;/span&gt;
                              &lt;span style=" font-size: 48px; color: #666666; font-style: normal; font-weight: bold; text-decoration: none; font-family: Arial;"&gt;20% OFF.&lt;/span&gt;
                              &lt;span&gt; &lt;/span&gt;
                              &lt;span style=" font-size: 48px; color: #666666; font-style: normal; font-weight: normal; text-decoration: none; font-family: Arial;"&gt;Do it NOW!&lt;/span&gt;
                              &lt;span&gt; &lt;/span&gt;
                            &lt;/p&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>My question is, how can I write a regular expression to remove these unwanted DIVs? Is there a better way to do it?</p>
  
  <p>Thanks in advance.</p>