Remove all content after the closing </html> tag

Tool for Search and Replace across multiple files.
Post Reply
AzMandius
Posts: 2
Joined: Mon Jan 05, 2015 4:38 pm

Remove all content after the closing </html> tag

Post 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!
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

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

Post 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!
AzMandius
Posts: 2
Joined: Mon Jan 05, 2015 4:38 pm

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

Post by AzMandius »

Perfect! Thank you my friend!
Post Reply