Remove all content after the closing </html> tag
Brought to you by:
olivierwehner
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!
Anonymous
Oh Dear!
Please try the following:
find: ((?s:.+?)</html>)(?s:.*)
replace: \1
\1 will take the content of the first (outer) bracket as content of the repaired file. (?s:X) will make the dot match anything including line breaks in the expression X. .+?X will match any character until the expression X is matched the first time.
Good luck!
Olivier
Thanks a lot Olivier!