How to remove comment HTML element in a String in iOS -


this last part of string:

</div>  </noscript><!-- g3.js-t oldalanként egyszer, </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 how want remove comment element, 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 different regex:

var regex = nsregularexpression(pattern: "<!--[\\s\\s]*-->", options: nsregularexpressionoptions.caseinsensitive, error: nil)! 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -