title: RegEx to match against HTML tags with certain attributes
body: <p>I’m trying to write a RegEx that matches an opening HTML tag with a <code>class</code> attribute on it. Just like the following:</p>
  
  <pre><code>&lt;!-- these should match --&gt;
  &lt;div class=" 
  &lt;div class="&gt;
  &lt;img src="image.jpg" class="
  &lt;img src="image.jpg" class="&gt;
  
  &lt;!-- these should not match --&gt;
  &lt;div&gt; class="
  &lt;/div class="&gt;
  </code></pre>
  
  <p>So far I have:</p>
  
  <pre><code>&lt;[^/^&gt;]+&gt;
  </code></pre>
  
  <p>This matches any opening HTML tag. I’m looking to adapt it to look for a <code>class</code> attribute within there too, like in the examples above.</p>