I have a HTML text with <!--[if gte mso 9]> and <![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.
This is what I've tried:
text = "<!--[if gte mso 9]><xml>\n <w:WordDocument>\n [...] \n</style>\n<![endif]-->"
text2 = text.gsub /(?=<!\-\-\[if gte mso 9\]>)(.*?)(?<=<!\[endif\]\-\->)/, ""
What I want as an answer is:
text2 = "<!--[if gte mso 9]><![endif]-->"
Or even:
text2 = ""
I tried this based on this article
I've tried this online Regex tester and, it seems to be the right way to do it, but it won't work on my program!
Please help!
Thanks in advance!