title: Regex Exclude Comments
body: <p>I want to have a Regex that will not return the strings that are enclosed in html comments starts in <code>&lt;!--</code> and/or ends in  <code>--&gt;</code></p>
  <p>I currently only have this to check if it is starting in <code>&lt;!--</code> and has a text equal to <code>hello</code>:</p>
  <pre><code>^(?!&lt;!--).*hello.*$
  </code></pre>
  <p>It seems to work fine but when I test my examples that are multiline, it doesn't return any match at all.</p>
  <p>Here is what I test it with:</p>
  <pre><code>hello there
  &lt;!- hello there --&gt;
  &lt;!-- hello there --&gt;
  </code></pre>
  <p>So I expect that the first two would be returned as matches:</p>
  <pre><code>hello there
  &lt;!- hello there --&gt;
  </code></pre>
  <p>But this Regex test returns no result, unless I only have the first line (<code>hello there</code>) given:
  <a href="http://regexr.com/5t1ng" rel="nofollow noreferrer">regexr.com/5t1ng</a></p>
  <p>Help anyone?? And how to have a Regex check to exclude in matches if ending in <code>--&gt;</code>?</p>
  <p>That is, I expect that:</p>
  <ul>
  <li><code>&lt;!-- hello</code> - shouldn't match</li>
  <li><code>hello --&gt;</code> - shouldn't match</li>
  <li><code>&lt;-- hello --&gt;</code> - shouldn't match</li>
  <li><code>&lt;!- hello </code> - should match</li>
  <li><code>&lt;-- hello </code> - should match</li>
  <li><code>&lt;-- hello -&gt;</code> should match</li>
  </ul>
  <p>Thanks!</p>