title: REGEX replace all " style='anything'" except within tables
body: <p>I am parsing html. I know this shouldn't be done with regex but dom/xpath. In my case it should just be fast, simple and without tidy so I chose regex.</p>
  
  <p>The task is replacing all the <code>style='xxx'</code> with an empty string, except within tables.</p>
  
  <p>This regex for preg_replace works catching all <code>style='xxx'</code> no matter where:</p>
  
  <pre><code>'/ style="([^"]+)"/s'
  </code></pre>
  
  <p>The content can look like this
  </p>
  
  <pre><code>&lt;!-- more html here --&gt;
  &lt;span style='do:smtg'&gt;&lt;table class=... &gt; &lt;span style="..."&gt;
  &lt;table&gt; &lt;div style=""&gt;&lt;/div&gt;&lt;/table&gt;&lt;/span&gt;&lt;/table&gt;
  &lt;!-- more html here --&gt;
  </code></pre>
  
  <p>or just simple non nested tables, meaning regex should exclude all <code>style='...'</code> also within nested tables. </p>
  
  <p>Is there a simple syntax doing this?</p>