This is the last part of my String:
</div>
</noscript><!-- A g3.js-t oldalanként egyszer, a </body> zárótag előtt kell meghívni -->
<script type="text/javascript" charset="utf-8" src="//ad.adverticum.net/g3.js"></script>
<div id="autosuggest"><ul></ul></div>
</body>
</html>
And this is how I want to remove the comment element, but it does not work:
var regex = NSRegularExpression(pattern: "<!--[^<]*-->", options: NSRegularExpressionOptions.CaseInsensitive, error: nil)!
str = regex.stringByReplacingMatchesInString(str, options: nil, range: NSMakeRange(0, count(str)), withTemplate: "")
Any idea why?
You can try using a slightly different regex: