I have text with converted html and line breaks and tabs and any other symbols like:
…
</div>
</div>
{/block:Faver}
</body>
</html>
some so bad text
what i need to cut
I need to cut with javascript (or jquery, if need) all text after keyword:
</html>
Have any ideas or examples?
You can do it with a regular expression. Usually, you’d need the ‘m’ modifier, for multiline, and the ‘s’ modifier, for dotall. Reference here:
http://www.regular-expressions.info/modifiers.html
However, the dotall modifier does not exist in javascript, so I usually go for a character class “[\x00-\xff]”. This regexp replace should do the trick: