title: Remove from <!--[if gte mso 9]> to <![endif]--> in HTML [REGEX, RUBY]
body: <p>I have a HTML text with &lt;!--[if gte mso 9]> and &lt;![endif]--> tags. I want to remove everything that there is between those two tags.
  I'm using the ruby function gsub with a Regex expression, but it won't work. </p>
  
  <p>This is what I've tried:</p>
  
  <pre><code>text = "&lt;!--[if gte mso 9]&gt;&lt;xml&gt;\n &lt;w:WordDocument&gt;\n [...] \n&lt;/style&gt;\n&lt;![endif]--&gt;"
  
  text2 = text.gsub /(?=&lt;!\-\-\[if gte mso 9\]&gt;)(.*?)(?&lt;=&lt;!\[endif\]\-\-&gt;)/, ""
  </code></pre>
  
  <p>What I want as an answer is:</p>
  
  <pre><code>text2 = "&lt;!--[if gte mso 9]&gt;&lt;![endif]--&gt;"
  </code></pre>
  
  <p>Or even:</p>
  
  <pre><code>text2 = ""
  </code></pre>
  
  <p>I tried this based on <a href="https://stackoverflow.com/questions/6109882/regex-match-all-characters-between-two-strings">this article</a></p>
  
  <p>I've tried <a href="https://regex101.com/" rel="nofollow noreferrer">this</a> online Regex tester and, it seems to be the right way to do it, but it won't work on my program!</p>
  
  <p>Please help!</p>
  
  <p>Thanks in advance!</p>