Menu

#49 Remove all content after the closing </html> tag

None
closed
5
2015-01-14
2015-01-05
az0000000
No

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!

Discussion

  • Olivier Wehner

    Olivier Wehner - 2015-01-05
    • assigned_to: Olivier Wehner
    • Group: -->
     
  • Olivier Wehner

    Olivier Wehner - 2015-01-05

    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

     
  • az0000000

    az0000000 - 2015-01-06

    Thanks a lot Olivier!

     
  • Olivier Wehner

    Olivier Wehner - 2015-01-14
    • labels: --> multi-line, replace
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel