Page 1 of 1

Remove all content after the closing </html> tag

Posted: Mon Jan 05, 2015 4:39 pm
by AzMandius
Hello everyone,
A virus infected all .html and .htm files on my HD, by inserting a portion of bad code after the closing </html> tag, in ~20000 files.

I would like to run a search and replace command that deletes everything after the </html> tag.

Would anyone be so kind to indicate a proper formula for doing that, if that's possible using this software.

Thanks a lot!

Re: Remove all content after the closing </html> tag

Posted: Mon Jan 05, 2015 4:51 pm
by DigitalVolcano
This will remove everything (to the end of the file) after the </html> tag.

Regular expression:

Code: Select all

</html>.*
Replace:

Code: Select all

</html>
Option: "Dot Matches Newline" turned on.

Remember to back up first!

Re: Remove all content after the closing </html> tag

Posted: Mon Jan 05, 2015 8:08 pm
by AzMandius
Perfect! Thank you my friend!